Tough Spawn Problem

googlemike at hotpop.com googlemike at hotpop.com
Sun Mar 6 01:37:24 EST 2005


I'm trying to use Python and PyGTK + Glade, along with Bash. I want to
make a GUI for the Linux vpnclient command-line tool. (Look for
linux-vpnclient.tar.gz on the Internet if you are curious.) Anyway,
this vpnclient tool connects to VPN and then stays locked like that
while the VPN connection is running. What I was trying to do was either
spawn it and then use another command-line tool to check on its status,
or shell the process and redirect all its output text to the GTK
textbox in the GUI. Here's the problems I found with that:

* Spawn - This seems to spawn the process okay, but when the vpnclient
connection is finally loaded, it holds the process and the GUI cannot
return to being responsive -- it locks the GUI up, essentially. I tried
os.NO_WAIT and os.DETACH but os.NO_WAIT was no solution and os.DETACH
only works in the documentation, not in my version of Python.

* Shell - This seems to do the same thing as spawn but instead of
sending output to a console, it sends the output into a console-less
space. Then, because the VPN connection is locked-in, it also holds the
GUI up and hangs it.

I tried using the " &" operator but that seemed to have no effect in
fixing this problem.

What's the trick?




More information about the Python-list mailing list