[Tutor] using python to start and stop a program

Joanna Ingrahm joanna9765 at yahoo.com
Mon Aug 18 11:11:51 EDT 2003


Hi Magnus,
sorry I didn't reply sooner!
> Hi Johanna, perhaps you can show us some code, and
> we
> might spot the problems in it. 

I tried s.th. like this:
saveout = sys.stdout
fsock = open('out.log', 'w')
sys.stdout = fsock 
os.spawnl(os.P_NOWAIT, "D:\\Apps", "prog.exe", "-l")
sys.stdout = saveout                                  
 
fsock.close()  



>In what way did writing
> the info to a file and reading it back fail. Writing
> or reading? Did it get to the file?

No

> Why do you need to store the pid in a file? 
It doesn't have to be like that, I just don't know how
else I could do it

Are you
> using separate python processes to start and stop?

so far I only tried to start  it

> Has
> the writing process exited before the other process
> reads the file?

I only have one process running so far...

thanks,
Joanna

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the Tutor mailing list