import subprocess
independent_process = subprocess.Popen('/path/to/pythonw.exe /path/to/file.py',
    creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
How do I implement a simple cross platform Python daemon?