![]() ![]() If you have spaces or certain other symbols somewhere in your filename you need to enclose the file name in quotes: python3 "~/Downloads/some directory with spaces/and a filename with a | character. py file in Finder.app and just drag it into the Terminal.app window which should type out the absolute path for you. ![]() Instead of typing out that whole thing ( ~/Downloads/my_script.py), you can find the. You can also skip step 3 and give python3 an absolute path instead python3 ~/Downloads/my_script.py How to run a Python script Drag it to PythonLauncher Select PythonLauncher as the default application to open your script (or any. In my case, I am going to type hello.py because it is the name of my script. Run the script using the python3 executable python3 my_script.py Type in the name of your python script and press enter to run your script. Install Python using Homebrew brew install pythonĬd into the directory that contains your Python script (as an example I'm using the Downloads ( Downloads) folder in your home ( ~) folder): cd ~/Downloads Install Homebrew (by pasting the following text into Terminal.app and pressing the Enter key) /bin/bash -c "$(curl -fsSL )" ![]() Open Terminal.app (press ⌘+Space and type "Terminal" and press the Enter key) There are many ways of installing Python, but Homebrew is the easiest. Let's say your script is called my_script.py and you have put it in your Downloads folder. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |