Search code examples
pythoncentosdaemonspawn

Python-Linux: run script in background from script


I've been trying os.spawnv to run script in background

os.spawnv(os.P_NOWAIT, "/home/R/daemon_excel.py", ["arg1", "arg3", "arg2"])

but daemon_excel.py doesn´t run


Solution

  • alternative: use subprocess:

    subprocess.check_call("/home/R/daemon_excel.py arg1 arg3 arg2 &", shell=True)