Python 102: Setup

Install Anaconda Python

The Anaconda Distribution of Python is required for this workshop. Instructions on where to download and how to install Anaconda can be found here.

If you’re using a Unix shell application, such as Terminal app in macOS, Console or Terminal in Linux, or Git Bash on Windows, execute the following command:

$ cd ~/Desktop/swc-python/data

On Windows, you can use its native Command Prompt program. The easiest way to start it up is by pressing Windows Logo Key+R, entering cmd, and hitting Enter. In the Command Prompt, use the following command to navigate to the data folder:

$ cd /D %userprofile%\Desktop\swc-python\data

 

Option 1: Launch Plain Vanilla Python interpreter

To start working with Python, we need to launch a program that will interpret and execute our Python commands. To launch a “plain vanilla” Python interpreter, execute:

$ python

If you are using Git Bash on Windows, you have to call Python via winpty:

$ winpty python

 

Option 2: Start Jupyter notebook

Jupyter notebooks provide a browser-based interface for working with Python. You should have Jupyter notebook on your system if you installed Anaconda Distribution.

To start a Jupyter server, execute:

$ jupyter notebook

Then create a new notebook by clicking “New” button on the right and selecting “Python 3” from the drop-down menu:

 

Option 3: Start IPython interpreter

IPython is an alternative solution situated somewhere in between the plain vanilla Python interpreter and Jupyter notebooks. It provides an interactive command-line based interpreter with various convenience features and commands. You should have IPython on your system if you installed Anaconda Distribution.

To start using IPython, execute:

$ ipython