Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python program cannot close
#1
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
Reply
#2
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.
Reply
#3
Hi Gribouillis,

Thanks for your enlightenment. My problem is solved..
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I Open and close .py file from python scripts SayHiii 9 5,620 Dec-17-2019, 06:10 AM
Last Post: Malt
  Does python guarantees that file.write() works without file.close() ? kryptomatrix 7 3,837 Oct-21-2019, 11:28 AM
Last Post: kryptomatrix
  Program-launching script will not close until the program it launches is closed mmwatson 1 3,217 Jun-21-2017, 10:31 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020