Nguyễn Pháp
New member
How do I run a Python script in the background Ubuntu?
Answer
First, you need to add a shebang line in the Python script which looks like the following:
Answer
First, you need to add a shebang line in the Python script which looks like the following:
- #!/usr/bin/env python3. …
- chmod +x test.py. …
- nohup /path/to/test.py & …
- nohup python /path/to/test.py & …
- nohup /path/to/test.py > output.log & nohup python /path/to/test.py > output.log & …
- ps ax | grep test.py. …
- kill PID. …
- pkill -f test.py.