Introduction to Python Programming

Contents

Introduction to Python Programming#

This workshop introduces Python for those that have little to no programming experience, and has two parts:

  1. A quick introduction to Python and the basics of processing and visualizing data.

  2. A more in-depth view into programming concepts in Python, including loops, conditions, functions, and debugging.

The workshop uses material from Software Carpentry’s Programming with Python lesson.

Preparation#

We’ll be using JupyterLab as our Python environment for this workshop. Be sure to follow the steps below and make sure they work for you prior to the start of the workshop.

Update your browser

The version of JupyterLab we’re using for the workshop, JupyterLite, requires an modern, self-updating browser. We recommend using the latest version of Chrome or Firefox, Safari and Edge may not work.

  1. Go to https://urcf.github.io/python-workshop/

  2. You should see the JupyterLab interface, which looks like this:

JupyterLite

  1. Double click on the “workshop.ipynb” notebook in the right-hand sidebar to open it. You should now see the notebook interface, which looks like this:

Jupyter notebook

  1. Click into the code cell and press Shift+Enter to run the cell. You should see a plot of a sine wave appear below it. It make take a few seconds to load and display, be patient.

Sine wave plot

If this all worked, you’re now ready for the workshop! If you encounter any issues, please get in touch over email and we’ll help you out.