This repository contains a basic introduction to Python programming aimed at a non-technical audience.
It was originally created for the “Introduction to Python” session at the Historical Network Research workshop 2015.
The easiest way to play with the notebooks is online through the service binder. It allows you to run all the code without installing anything, but your changes will not be saved.
Alternatively, you need to install Python. There are two versions of Python: Version 2, which is older, but still used, and the newer Version 3. This introduction uses Python 3.
The easiest way to get Python with all the additional modules that we will use is the Anaconda installer.
- Go to https://www.anaconda.com/download/.
- Select the “Download” button for the Python 3 version (currently 3.7).
- If you run into issues, consult the installation guide for your operating system.
We will use the “Juptyer Notebook” to write Python code. It allows you to run snippets of Python in a web browser and immediately see the results.
There is a utility called “Anaconda Navigator.” Open it through the application menu and select “Jupyter Notebook” from the window.
Open a Terminal window and type:
conda activate
jupyter notebook
If you want to store your notebooks in a custom directory, then you can change into that directory first:
cd ~/Documents/MyNotebooks
jupyter notebook
This repository will contain the examples from the session. In order to run them locally, follow these steps:
- Click the “Clone or download” button and select “Download ZIP.”
- Unpack the downloaded ZIP file.
- In the Jupyter Notebook, navigate to the files’ location and start the individual sessions.