Make sure that you make it executable as well via chmod or however you do that sort of thing using Finder, or things will not work. I saved mine as /Users/tmartin/local/bin/runInTerminal.sh. ![]() Below I’ve outlined one way to go about this.įirst, we create a shell script which, when when executed, does what I outlined above open up a new terminal window using the Terminal application, then get it to do something. You need to go a different route for MacOS you need to first open up a new terminal window using the Terminal application and then tell it to run python (and your script). As a result, it’s either giving you an error code or it’s running what you told it to run in the background and you never get to see it. In fact os.system works just fine, it’s just not opening a terminal window for you because while Windows needs to open a command prompt to run a console application, Unix operating systems (such as Linux or MacOS X) do not. ![]() Your problem is less that it’s not valid in OSX (because it very clearly is), but that it doesn’t do what you think it does.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |