Teaching cPython and Web Development in the Browser
Class Notes
Python (Pyodide) Class Notes

Python (Pyodide) Class Notes


This is the users training, not the developers training.


Pyodide is cPython compiled to Web Assembly.  It is both great and has its limitations.  It is great, because it really is cPython, runs fast and most Python libraries can be ported to it.  It's limitations are WASM limitations.  No debugger (yet), and no direct network access.  Javascript has to load the libraries. 

This application is really running two Pyodides.  One in the main window, on every key stroke it does syntax checking by compiling the code.  The other one  is in the iFrame for running the REPL and programs.  

1. Show it really is Python 

import sys

sys.version

2. Try out an obscure Python command. 

 sys._getframe()

3. Sign up for my advanced Pyodide class. 

4.  Homework.  Get turtle graphics working and share the code.  

5. Confirm that it misbehaves just like Python