I have more than one command that has to be executed on the shell and I want to the run all the commands on the same shell . I have the commands stored in a file(command.txt
) and I want all of them to be executed in a single go using the subprocess.run()
function in python
I tried something like this but this doesn't work.
subprocess.run(str(open("command.txt")),shell = True)