Problem with os.spawnv, system, execv etc.

hejduk claxtonr at beer.com
Mon Apr 8 00:37:30 EDT 2002


Hi, I'm trying to make a small menu widget to go on my Linux 
Enlightenment desktop, using pyGTK. Bascally it's a window that is
populated with a few buttons that our supposed to be shortcuts to some
of my favourite apps. I've got the buttons to work except for one
problem: when I press a button to start an app the menu widget becomes
unusable until that app is shut down, at which time control is
returned to it. Needless to say this doesn't make for a very useful
menu program. I'm using callbacks to call the following function
whenever a button is pressed:

def progExec(self, file):
       import os
       os.spawnv("P_NOWAIT", file, ('' '', '' ''))

I've tried using "P_WAIT, P_DETACH," etc. I've also tried using the
os.system and os.execv, but the result is always the same. Same story
when I try starting the menu widget with Enlightenment so as to free
up the command console. Is there any way to set up the menu program to
work independent of any of the programs that it starts, ie: so I can
start several programs at once using it and perhaps add some other
features.


Also, why do the os.spawnv and os.execv functions require that extra
arguement to supply arguements to the starting program. What if I
don't want to supply any arguements to the programs I'm starting? My
example function above causes a bunch of errors to be listed when the
program starts up. Is there any way to get around this?

Thanks in advance,



More information about the Python-list mailing list