This is reference to video 17 from the “Python Standard Library” section of Mosh’s Complete Python Mastery. The video is entitled “Running External Programs”…
I can’t get any subprocess.run() to run, whether or not they are just commands for the command line, or .py files, or even .txt files. The code provided in Mosh’s video is…
import subprocess
result = subprocess.run([“ls”])
print(type(result))
When run with the terminal in Visual Studio, this results in an error of “FileNotFoundError: [WinError 2] The system cannot find the file specified”. This true regardless of what command I run. When I run a program, like a.py file, I instead get the error “OSError: [WinError 193] %1 is not a valid Win32 application”. I’ve read this could perhaps come from a mismatch in VS version and OS (64 vs 32 bit), but this is not the case for me. I’ve also read this can come from downloading multiple instances of python. If this can result from downloading both Visual Studip and PyCharm, this might be the case? But I didn’t think downloading two development environments was the same as downloading two distinct versions of python itself. Thanks in advance