Firstly, please excuse my lack of knowledge; I am a complete beginner at python.
I would like to run several command line commands from within a python script, using the subprocess
module. My python script is supposed to be an application that downloads files from a url. These commands are shown below:
set /P _inputname= my-url-here
wget %_inputname%
(wget is in the same directory as my python script)
I have tried using this method:
cmds = ['set /P _inputname=', 'my-url-here', 'wget %_inputname%']
subprocess.run('cmds', shell=True)
However, it fails to run wget
.
I understand that my question may seem very similar to this question and this question. However, the solutions in the aforementioned posts have not worked for me. Is there an alternative method?