Python Forum
Python program cannot close - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Python program cannot close (/thread-28412.html)



Python program cannot close - kwekey - Jul-18-2020

Hi, I need some help on this peculiar problem.

I have 2 ubuntu machines running the same python program using 2.7 IDLE.

On machine A, when I close the Python Shell console window, python program is close completely.
On machine B, when I close the Python Shell console window, console window closes, by the python is still running in the background. I need to run sudo pkill python to close the program completely.

Another observation,
On machine A, when I run the program from IDLE, Python shell console shows "RESTART <program_name.py>"
on machine B, when I run the program from IDLE, Python shell console shows "NO SUB PROCESS" without showing "RESTART <program_name.py>"

I believe it is due to some environment setting.
Can someone enlighten me on this problem?

Thanks and in advance.

kwekey


RE: Python program cannot close - Gribouillis - Jul-18-2020

If idle is run with the -n command line switch, it will run without a subprocess, which means that Idle won't start a new process when you hit F5 to run your program.

In recent pythons, starting Idle without subprocess throws a deprecation warning.


RE: Python program cannot close - kwekey - Jul-18-2020

Hi Gribouillis,

Thanks for your enlightenment. My problem is solved..