Hi,

Let's say we have two test cases:
1. Run the 'run_as_thread.py' script from Spyder
2. Run it from Windows command prompt

If I understand correctly:
  * in case #1, the external process is terminated only when you quit
Spyder but not when you kill the Python interpreter
  * in case #2, the external process is terminated when you close the
Windows command prompt

When creating a new process with subprocess.Popen, this new process is a
child of the Python interpreter process. However, AFAIK, Windows does not
force child processes to close when a parent process closes. In other
words, processes are independant in Windows. So, from my point of view, the
question is more: why is it terminated in case #2?

-Pierre


2013/5/27 Markus Roppelt <[email protected]>

> Hi,
>
> I want to start a program which runs endlessly from within another script.
> Therefore I am using a thread to start an external subprocess.
>
> The two attached scripts demonstrate the problem:
>
> If I start the script run_as_thread.py from Spyder the scripts starts the
> test.py correctly. However the child process is not terminated if I close
> the interpreter. The process can only be killed via the windows task
> manager or by closing and restarting Spyder.
>
> From the normal command-line the script run_as_thread.py has the expected
> behavior and closes the test.py process if I close the window.
>
> Can anyone give me hint how to get his working within Spyder or this a
> known issue / bug?
>
> Thanks
>  Markus
>
> --
> You received this message because you are subscribed to the Google Groups
> "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/spyderlib?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to