Introduction to Python

learning Python
teaching
art
Learning to code with pixel graphics
Author
Published

December 20, 2024

Modified

January 6, 2025

This page contains some experimental work I’m doing to build a package that introduces arrays, objects, and plotting in Python in an intuitive and visual way. Please note that this page is a work in progress; please feel free to look around, but be warned content might change/break/disappear as I update it!

This page uses Pyodide to run code directly in your browser. Please give the site a moment to load and install all the required Python packages. To run the code, please use the blue “Run Code” button to the right of each code chunk.

When using this to teach, I envision using the PRIMM approach: Predict, Run, Investigate, Modify, and Make. The below absolutely does not constitute a lesson plan or tutorial, and is simply an exploration of how this Pyxel (working name) package might be used in a teaching context.

First, we instantiate a canvas:

Once the above is run, we can see both our blank canvas and our palette. We can paint pixels by simply setting the location in the array equal to the desired colour in the palette with the corresponding number (essentially paint-by-numbers).

Experiment setting rows and columns:

The package also has the ability to set the initial canvas to whatever size required, create custom palettes, etc. I have not yet written documentation, but documentation following the NumPy standard for example could then also be used for teaching.

Back to top

Citation

BibTeX citation:
@online{murphy_quinlan2024,
  author = {Murphy Quinlan, Maeve},
  title = {Introduction to {Python}},
  date = {2024-12-20},
  url = {https://murphyqm.github.io/docs/projects/teaching-python/intro_to_python.html},
  langid = {en}
}
For attribution, please cite this work as:
Murphy Quinlan, Maeve. 2024. “Introduction to Python.” December 20, 2024. https://murphyqm.github.io/docs/projects/teaching-python/intro_to_python.html.