1

I have the electrum wallet on my Linux PC, and in order to run it i enter electrum into the command line, but this and many other programs would then require a million open terminals, so I just enter electrum &, and the & automatically detaches the script and 'creates' a process from it.

My question now is: How can I do this from within python for my own program (which is a tkinter gui), that does exactly the same thing as adding a & to the end of the command? This is probably platform-dependent, but if there is an easy linux version, that would be enough.

I tried googling this issue, but the & behind the command line is the only solution I actually came across.

Maritn Ge
  • 997
  • 8
  • 35
  • `&` just puts it in the background. The process is still a child of the shell and is not entirely detached (for instance it would still get hangup signal -- you need to either `disown` or use `nohup`). As for your question: Not sure what you want to do but wouldn't a plain old `POpen` do what you want? – UltraInstinct Dec 29 '20 at 13:26
  • @UltraInstinct what I want to happen when I run my script is that it runs as if the terminal never existed, basically, running independently from the terminal, if that makes sense – Maritn Ge Dec 29 '20 at 13:29
  • Does this answer your question? [How do I daemonize an arbitrary script in unix?](https://stackoverflow.com/questions/525247/how-do-i-daemonize-an-arbitrary-script-in-unix) – pilcrow Dec 29 '20 at 14:47
  • @pilcrow sadly no, as I want to do it from wihtin python, if possible. – Maritn Ge Dec 31 '20 at 16:23
  • Does this answer your question? https://stackoverflow.com/a/3383762/132382 – pilcrow Jan 01 '21 at 00:00

0 Answers0