[Tutor] using python to start and stop a program

Magnus Lyckå magnus at thinkware.se
Tue Aug 12 17:34:50 EDT 2003


Hi Johanna, perhaps you can show us some code, and we
might spot the problems in it. In what way did writing
the info to a file and reading it back fail. Writing
or reading? Did it get to the file?

Why do you need to store the pid in a file? Are you
using separate python processes to start and stop? Has
the writing process exited before the other process
reads the file?

At 17:35 2003-08-10 -0700, Joanna Ingrahm wrote:
>I have a program that I have to start using the win32
>comand line. to stop it I use ctrl+c.
>Now I tried to do that using python but still have
>problems with it.
>I can start the program and receive the pid of it
>using:
>
>os.spawnl(os.P_NOWAIT,...
>
>but then how can I use that information to terminate
>the process again? I tried to write it in a file and
>read it again but couldn't get it to work.
>Appreciate any help!



--
Magnus Lycka (It's really Lyckå), magnus at thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language 




More information about the Tutor mailing list