Python
Getting started in Python for CS136
We will use Python (specifically, Python 3) for all of the programming problem sets in CS136. If you have absolutely zero experience coding in the language, try this tutorial or reach out to the TFs for more resources.
Installing Python
MacOS
These instructions assume your Mac has not had Python installed on it before.
Conveniently, MacOS comes with Python 3 pre-installed now-a-days.
You can use it by opening terminal and running python3 -V to confirm the installation (should display 3.x.x).
Note that running python -V will still show a 2.x.x version of Python.
If you find writing out python3 annoying to run a Python 3 script, run
echo -en "\nalias python='python3'\n" >> ~/.zshenv && source ~/.zshenv
Running python -V should now show a 3.x.x version.
Windows
These instructions assume your PC has not had Python installed on it before.
Windows does not come pre-installed with Python, but does have an official distribution now.
To install Python 3, open a command prompt and run python
This will open the Microsoft Store where you can install Python 3.
After it's done installing just open a new command prompt and confirm it worked with python -V
Linux
You already know how to install Python.
Text Editors
You can get Python support in most modern text editors, but if you already dont have a favorite, here are two options:
PyCharm: full featured Python editor with all the support you need out of the box. Doesn't work with other languages out of the box. Better for beginners.
VSCode: More stripped down editor but has thousands of extensions (including a great Python one). Better if taking classes in multiple languages. Requires more setup.
For most people reading this, PyCharm is probably what you want. It just works.