Starting a python GUI from another python GUI.

Travis Beaty t_beaty at mchsi.com
Wed Jan 8 12:40:16 CET 2003


Hello Jens!

I'm an extreme newbie myself, however ...

Since you are developing in Windows, I have a sneaking suspicion that 
its not pythonw generating the console window, but rather your call to 
os.system().  In Python's win32API wrappers, they have wrapped a 
function by the name of ShellExecute().  You can find the MSDN 
documentation for this function here: 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shellexecute.asp. 
  The Python documentation is here: 
http://aspn.activestate.com/ASPN/Python/Reference/Products/ActivePython/PythonWin32Extensions/win32api__ShellExecute_meth.html


Using ShellExecute() **should** keep the console window from opening, 
but no guarantees.  (I don't have Windows, so I can't test my theory, 
sorry.)  Hope I've helped.

Have a wonderful day!

Travis Beaty
Mason City, Iowa.


Jens Bloch Helmers wrote:
> I'm trying to launch a python GUI from another python program
> using the command:
> 
>      os.system('pythonw GUIapp.py')
> 
> but an unnecessary console window pops up when the above statement is
> executed despite the use of pythonw.exe instead of python.exe.
> A funny thing is that no console window appear if the above statement
> is executed from a non-GUI python script.
> 
> What is the best way to launch a stand-alone python GUI from another
> python GUI? (Without console windows...)
> 
> (I'm using python2.2.2 / winXP / wxpython2.3.4.2)
> 
> Jens
> Python Newbie





More information about the Python-list mailing list