Reputation: 29
I have recently started using a program which has command line interfaces accessed through the Mac Terminal. I am trying to automate the process whereby a series of commands are passed through the terminal using Python. So far I have found a way to open the Terminal using the subprocess.Popen command but how do I then "write" in the terminal once it's open ? For example what I am looking to do is; 1. Open the Terminal App. 2. Select a directory in the App. 3. Run a command. In this instance the file I wish to run is called "RunUX" and what I want to type is "./RunUX ..." followed by command line arguments. I'm fairly new to Python and programming and appreciate all help !! Thanks
Upvotes: 0
Views: 476
Reputation: 29
Thanks for the comments guys but I managed to figure it out. In the end I used a combination of subprocess.Popen() and os.chdir() and it seems to work using Jupyter Notebook.
Upvotes: 1