

Inside this folder, I have several Python scripts. In the terminal, navigate to the directory where your Python script is located by using the cd command.įor example, the command below will change my directory to the dev directory. For example, you can open the terminal on Ubuntu by pressing CTRL + ALT + T.Ģ. Linux will vary depending on the operating system. You can find it by going to launchpad and searching terminal. Load the terminal application on your Mac. To open the command prompt on Windows, press the Windows Key + R, type in cmd, and press Enter. On macOS and Linux, it is known as terminal. For example, on Windows, this is the command prompt. Load the terminal application on your chosen operating system. Below are a few short steps that you will need to complete to run a script successfully.ġ. Running a Python script in the terminal is very straightforward but requires you have Python already installed. If you encounter any issues, your system may not have Python configured correctly. The steps below will take you through all you need to know to run a Python script. These are all straightforward and will not take long to complete. We have tutorials on installing Python to Windows, macOS, and Linux. This tutorial will touch on how to run the script within the terminal or in an IDE like Visual Studio Code ( VSC).įor this tutorial to work correctly, you will need to install Python to your chosen operating system. Please let me know if this doesn't work for you.In this tutorial, we will go through the steps on how you can run a Python script on your computer.Įxecuting a Python script is very easy within the terminal or IDE (Integrated Development Environment). Which is exactly what the Installing Python on Mac OS X I cited above recommends: $ /usr/bin/ruby -e "$(curl -fsSL )"Įxport PATH=/usr/local/bin:/usr/local/sbin:$PATH The version of Python that ships with OS X is great for learning butĪpple made some changes in El Capitan (including System Integrity Protection) that could cause installs to fail with the infamous "no software found to install". To use other third-party Python libraries. Should always install Setuptools, as it makes it much easier for you Tools and libraries described in the next section before you startīuilding Python applications for real-world use.

Having said that, I would strongly recommend that you install the

You do not need to install or configure anything else to use Python. The latest version of Mac OS X, El Capitan, comes with Python 2.7 out Invocation, or use its Preferences menu to change things globally. Option-dragging allows you to change these for one PythonLauncher has various preferences to control how your script py script) through the finder Info window and double-click

Select PythonLauncher as the default application to open your script Assuming Python is installed, this should work:
