Also see - Python on Chromebooks - a subpage for getting your development environment set up on your Chromebooks
Contents of this page
We'll be using Python version 3.11. Available from Python.org.
This version is the reference implementation and is often called CPython. There are other Python interpreters that interface with Java, C#, or JIT compile etc...Python is distributed with Tkinter, an interface for the Tk GUI framework. We will use PySimpleGUI which wraps Tkinter Flet, which wraps Flutter for Python.
There are lots of GUI frameworks.The easiest way to bundle your apps for distribution is to use Auto PY to EXE - can create installs for Windows, Macs & Linux.
repl.it is a service providing interactive programming environments - recommended for projects
Python Tutor - A really good way to view the execution of (simple) Python programs
Trinket is a good Skulpt based service that has online storage, sharing and tutorials.
CodeSkulptor is another Skulpt based service used for Intro to Interactive Programming in Python on Coursera. Note: it does not save your work on the cloud.
Anvil - A full stack Python Web App environment
Other Options:
Jupyter notebook in the browser - common in scientific and data oriented programming. There are many ways to run such notebooks in the cloud, including Google Colab, Kaggle Notebooks, CoCalc, etc...
and more.... makeuseof.com try python free interactive shells
It was #1 in the 2017, 2018, 2019, 2020, & 2021 IEEE ranking of top programming languages
It has a clear, consistent syntax that makes it a good language for beginners
Minimal boilerplate makes it an efficient language to code
It is cross-platform, open source, small footprint language
It is a mature language with a complete and accessible ecosystem of libraries (PyPI)
It is used in enterprise applications by large companies
It is widely used in science, mathematics, statistics, data science, engineering, economics contexts.
Awesome Python Applications (a list of opensource apps to explore)
Pure interpreted Python is comparatively slow and inefficient
This is eased by optimizing the key parts using C Extensions such as Numpy or Tensorflow or PyGame etc...
Also see Cython, Numba, PyPy, etc...
Often the speed of execution is not that important and the speed of writing / ease of expressing ideas is more significant
Python 3 is getting faster every year
Not very good at writing iOS or Android applications or Front-ends for websites - although it is possible
Kivy is good for this for cross-platform apps/games, although it doesn't reproduce the native look. QPython also contains other options. BeeWare is promising but underdeveloped.
See Anvil for a full Python webstack
See Retiring Python as a Teaching Language for another take.
PyScript PWAs can also address some of these issues: eg
Our main exercise set is the booklet handed out and found on the Unit 3 Outcome 1 (Programming) page. Handy tool for visualising Python code running is Python Tutor (also see Dis This and Recursion Visualiser)
Advice: Choose ONE main reference to work through and supplement with ONE secondary reference for when the first is confusing. Any more than that, you will spend too much time reading and not enough time doing.
Textbook - A practical intro to Python Programming - Recommended
Foundations of Python Programming - Online & Open textbook on Runestone Academy. (There are other books on that site that are also great resources, e.g., Think Python & How To Think Like a Data Scientist, etc...)
A Byte of Python - A good introduction - needs to be supplement with exercises or projects
The Python Tutorial - The official tutorial
Real Python - Lots of good tutorials, articles, videos, etc...
Dive into Python 3 - Is a good resource that covers a good overlapping set of more advanced Python knowledge
Grok Learning - An Australian site used to teach computing and digital technology skills - used at FHS in years 7-11. It has a decent Python sequence with exercises, but is not free.
CheckiO - A large collection of exercises to explore over a range of floating islands
Also see the Year 11 Applied Computing Python Page
The primary reference is PySimpleGUI @ readthedocs, especially the Cookbook full of examples
And of course, see our slides!
Example & Useful code from FHS
Modern Python Developer's Toolkit - resources on moving from small exercises to a more professional projects
Regular Expressions - useful to know
Generate, Test and Learn RegEx: https://regexr.com/
Python RegEx Tutorial on Runestone Academy [Fix Link?]
Databases
Python is distributed with SQLite - a fast relational database stored in a custom binary file format
TinyDB is a multi-table, document database that is stored (by default) in a JSON file.
Key-Value database in repl.it & package on PyPI
SQL in Khan Academy (Intro to databases and SQL - not Python)
SQAlchemy - ORM for Python (more advanced) - also see the Django ORM
Also see the Year 11 Applied Computing Python Snippets page
useful when playing with code directly in the Python shell
from os import chdir
chdir(r"D:\Simon\12SD\PythonExamples") # raw string with Windows-style path
The Zen of Python: import this
The smallest "hello world" program: import __hello__
Make your code more C-like: from __future__ import braces 😎
Replace != with <> (and more): from __future__ import barry_as_FLUFL
Python From Scratch - U Waterloo - A nicely paced intro with videos and quizzes (Can run code in their Python Panel)
Hyperskill (Python track) - A good project-based learning resource from Jetbrains. I like the knowledge map. Used to be free :'(
LearnPython.org - A good introduction (can run scripts and iPython interactive sessions online)
Object Orientated Programming with Python - A good online textbook with exercises and a Tkinter introduction
Data Camp - Although it is mainly focused on data science skills, the intro to Python is relevant to us.
Grok Learning - This is a good site that we use in Year 11 Computing. The larger courses on the site are not now free.
Practice Python - A good collection of Python exercises - ranked by chilis.
PyNative - OK tutorials. Some handy quizzes for self testing. [Has improved recently, need to look at it again]
Packt Publishing - Learn Python Programming - free book
Snakify - OK sequence with exercises. However, overly math-heavy and teach some bad variable naming practices and poor user interactions.
Codecademy - Don't use this! The free Python course is only Python 2. The sequence is OK when supplemented with a project or other assessment task