Reputation: 35
Is there anyway to terminate a python program only when the user shutsdown the system? I want to include the condition in the while loop so that it keeps on looping till the system shutsdown. Also is there a way to start the program automatically on booting the system?
Upvotes: 0
Views: 74
Reputation: 2085
Convert your python app to linux service is much better than white true only
Upvotes: 2
Reputation: 23546
This works for me:
while True :
pass # do something
This loop will be terminated when the system shuts down.
Upvotes: 2