I’ve been trying to make a data scraper for job searching and utilize wget in my Python script through subprocess library. I am trying to read from a .txt file with links with
bash_commandList = ['wget','--directory-prefix', '/Users/user/wgetLinks' '-E' '--input-file=/Users/user/Documents/output.txt']
subprocess.Popen(bash_commandList,stdout=subprocess.PIPE)
It works fine when I feed bash_commandList
as a whole String with shell=True
, though it doesn’t work with a list like above without it(and apparently it’s not a good practice to use shell = True). Why is the reason that I cannot use the list notation?
New contributor
user24330119 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1