1

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.

Hamza Safdar
  • 113
  • 5

1 Answers1

0

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 &
Gabio
  • 9,126
  • 3
  • 12
  • 32