Hi, Because this is the safest and cleanest way to run a Python script (or a Python interpreter).
1. The safest way If we run a Python script in the same process as Spyder itself, we won't be able to interrupt it and if it crashes, Spyder will crash too - that is clearly not acceptable. We could run a Python interpreter or Python scripts in the same process as Spyder but in a separate thread (the Spyder's internal shell widget may be executed in multithreaded mode) but then we won't be able to play with graphical user interfaces (GUIs can't be manipulated outside the main thread, i.e. Spyder's application thread): that would be a huge limitation. 2. The cleanest way If we run a Python script or interpreter in the same process as Spyder itself, its namespace would be polluted by Spyder's internals. So the script behavior may be different than when we would run it outside Spyder. Please don't hesitate to ask if my explanations aren't clear or about other aspects of Spyder's source code. Cheers, Pierre Le 7 août 2011 à 12:28, Uwe Schmitt <[email protected]> a écrit : > Hi, > > I just try to get into some spyder internals: > what is the reason for putting the external console in a separate > process ? > > Regards, Uwe > > -- > You received this message because you are subscribed to the Google Groups > "spyder" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/spyderlib?hl=en. > -- You received this message because you are subscribed to the Google Groups "spyder" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/spyderlib?hl=en.
