Exiting a python program

Exit an endless loop Python program This method uses an interrupt to capture keyboard CTRL+C entered on the command line, but then cleanly exits from the program’s main loop.

Read More

Making a python file executable

#!/usr/bin/python If the script is made executable, the operating system will use that first line to know which interpreter to run to parse the rest of the file.  If you always run python scripts from the command line like python myprogram.py then you could remove this line if preferred.

Read More

Auto running your program – Linux

Auto-running a Python file within a terminal window See our page here. Auto running a program with auto restart on crash See our page here. Make the .sh file executable and then run it. To forcibly exit use: CTRL+C

Read More