Recently I have encountered the issue in Rhino Python Editor. So the issue is that my print command will not print content in the console screen (output tab), After some testing, it seems that it only happens to print commands after obj.ExpireSolution(True). gh.CloseAllDocuments() and gh.OpenDocument() may also affect the print function as well.
Another issue is that there are no varaibles stored in the Variables tab.
I do not know about the exact setup of that function, but I think that @stevebaer might know more precisely. Generally the print function fills the window via a callback, and that callback has to be set to a GH-specific value by GhPython. I think that was scope-specific but… I need to investigate this with Steve or possibly @Alain to tell more.
I used the following commands to write directly to the Rhino Command line:
System.Console.SetOut(Rhino.RhinoApp.CommandLineOut)
System.Console.WriteLine(output)
The following line was possible to use in the ghpyton node to redirect the output to a text file.
sys.stdout = open(r"c:\temp\logfile.txt", “a”)
This way I could read the output from the file and redirect it to the Rhino console. For some methods like the the unittest module it was easier to collect the output directly.