Hi Richard,
Since you want to create a separate process, your best bet would be the
subprocess module. It replaces the os.spawnvp. The reason yours doesn't work
is that you have a "WAIT" flag which "waits until the other process
finishes", thus freezing your GUI. You can use the os module, but you would
need to use the os.P_NOWAIT mode. I would recommend using something like
this though:
subprocess.Popen('kchmviewer filename')
If your viewer program is not in your system path, you will need to include
the path to it. The same applies if your file is not in the directory that
the script is run from.
Since I do not run Linux, I cannot test this, but it should work.
Mike Driscoll
···
-----Original Message-----
From: Richard Terry [mailto:rterry@internode.on.net]
Sent: Sunday, January 28, 2007 4:22 PM
To: wxPython-users@lists.wxwidgets.org
Subject: running a help file from within your program
I used this code attached to a toolbar button to launch my help filie:
try:
os.spawnvp(os.P_WAIT, 'kchmviewer', ['kchviewer', filename] )
except:
pass
Runs the help ok, but then my program interface 'hang's, ie the help program
is still attatched to my gui. If I close the help, my gui comes back. If I
click on the task bar to get back my gui, my gui is just an unresponsive
blurred mess.
Any ideas?
richard