简体   繁体   中英

How to make a python file run as a seperate process/thread

I am scraping webs using beautifulsoap and Selenium in python. in ubuntu when i run a python file like python3 filename.py then i didn't able to perform some other task in the same terminal, until that python script finish its execution.

Is there any way through which i run a python file from terminal and then make it independent from it. so that i can work on the same terminal while that python file is executing in background.

I will be thankful for your response.

In order to run script in the background, in macOS and linux you can use:

python3 filename.py &

If you want your script will continue running after the terminal is closed, you can use:

nohup python3 filename.py &

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM