More Generally: How can I run a process that runs from the terminal with required keyword arguments using python?
It seems subprocess.Popen is what I want to use.
Here is what I try to run from inside a script:
from subprocess import Popen
Popen(['goodreads-user-scraper', '--user_id 149832357'])
“goodreads-user-scraper” is recognized, but I don’t understand how to pass a keyword argument. I know how to pass an argument, but if I remove “—user_id” I still get same problem.
I have installed goodreads-user-scraper. It works well from the terminal. It is a python package that you can run from the terminal. Repository found
Research
In my research I have found these two that seem helpful, but I haven’t been able to adapt the answers to my needs:CodePudding user response:
Separate all of your arguments like this:
from subprocess import Popen
Popen(['goodreads-user-scraper', '--user_id', '149832357'])