Within a python program I need to run a command in background, without displaying its output. Therefore I'm doing os.system("nohup " + command + " &")
for now.
Edit : command
shouldn't be killed/closed when python program exits.
However that will only work on Linux, and the content of the file will end up in nohup.out
but I don't need it there. Therefore I'm looking for a platform independent solution.
os.spawnlp(os.P_DETACH, command)
doesn't work, even with the *p
version so as to be able not to enter full path to application.
NB. I know that command
is generally platform dependent, but that's not the point of my question.