Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Python programs in the background?

I have a Python program that interfaces with the browser, and now I meed to make that as my background process, so that every time I click the button, the program should start running in the background.

Can anyone help me with an easy solution for this?

like image 689
Anusha Avatar asked Mar 09 '11 04:03

Anusha


People also ask

How do I stop a Python program from running in the background?

If the program is the current process in your shell, typing Ctrl-C will stop the Python program.


1 Answers

If you're on a Unix-like system (e.g. Mac OSX, Linux), the command is python myscript &, which runs the command in the background. In general, in bash (as well as most other shells) if you append a & to your command it runs the command in the background.

like image 63
Rafe Kettler Avatar answered Oct 23 '22 09:10

Rafe Kettler