I have the following line of commands used in sequence from the command window. cd path 1 && file.bat && cd path 2 && printfNav path3 > Testing.txt
Is it possible to have this done through python?
I have the following line of commands used in sequence from the command window. cd path 1 && file.bat && cd path 2 && printfNav path3 > Testing.txt
Is it possible to have this done through python?
You are looking for the os.system()
method. You will need to import os
into your python program and then using this method you can send commands to the terminal. The method takes in a string and acts as if you typed that into your terminal. For example os.system('pwd')
would cause the terminal to print out your current working directory, and so on so forth with other commands.