I need help calling a file from a python script. The file executes some commands that I need to run from python.
import subprocess
name = open(“filename.bat”, “r”)
subprocess.run(name)
I see no output. Nothing happens. If I do print I see the complete file but I need to execute commands it has. Any help is appreciated
import subprocess
name = open(“filename.bat”, “r”)
subprocess.run(name)
New contributor
Safeena is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.