I have a simple python script I run on linux that has a "while True:" loop that I run on startup. I need it to run constantly. I currently just add & to the end of the linux command line when starting it. Is there a simple way to have if fork rather then have too use the & when I run it?
import socket
import sys
from datetime import datetime
import os
while True:
print "hi", "there"
sleep(100000)
#do stuff
I primarily want to just detach my script from the tty so the user can exit the tty and it continues to run.