I'm running an etcd
process, which stays active until you kill it. (It doesn't provide a daemon mode option.) I want to detach it so I can keep running more python.
What I would do in the shell;
etcd & next_cmd
I'm using python's sh
library, at the enthusiastic recommendation of the whole internet. I'd rather not dip into subprocess
or Popen
, but I haven't found solutions using those either.
What I want;
sh.etcd(detach=True)
sh.next_cmd()
or
sh.etcd("&")
sh.next_cmd()
Unfortunately detach
is not a kwarg and sh
treats "&"
as a flag to etcd
.
Am I missing anything here? What's the good way to do this?
subprocess.Popen('python file.py')
on Windows returnsFileNotFoundError: [Errno 2] No such file or directory: 'python file.py'
. What could be the problem? – Threlkeld