5.1. Resources#
5.1.1. Reading#
Here’s an awesome free open access text book on Python, you can get it for free as a pdf, browse the web version or buy a hard copy. Be sure and read the preface about the history of this book!
5.1.2. Setting up your own computer#
I encourage you to download VS Code [*], a free programmers text editor [1] that has a sophisticated debugger. Debuggers are extremely useful for understanding program flow and fixing errors. Before you can use it you need to install Python3.10 on your computer (see below).
This is provided by Microsoft and is available for all operating systems.
Once you have installed Python 3.10, open VS Code. Open the Extensions section and type in Python
. Select the Python package distributed by Microsoft and click on the install button. That extension provides a bunch of super useful tools including the aforementioned debugger.
5.1.2.1. Install Python3.10 on macOS#
There are multiple ways to install Python on a mac, what I’m recommending will allow you to remove this installation of Python easily after the course has finished (if you should want to do that).
Step 1 – open the Terminal.app.
You can use Spotlight (typically invoked using command+<space bar>) to find it, or navigate to /Applications/Utilities/Terminal.app
. Once it’s open, click anywhere in the Terminal window and you should see your cursor as a grey box following a “prompt” character [2]. Enter the following text and press the return key:
xcode-select --install
and follow the prompts [3].
Typically this is a single $
or >
character.
It will ask for your password and install some essential command line tools.
Step 2 – Install Homebrew
Homebrew is a “package manager”, a command line tool to make installing other command line tools easy. Follow the install instructions. When completed, enter the following text and press the return key:
brew install python@3.10
When that is completed, you have Python 3.10 installed.
5.1.2.2. Install Python3.10 on Windows#
See the information here.
5.1.2.3. Adding support for Jupyter notebooks#
As we use these heavily in the course, having the capacity to create and run them on your own machine may prove useful. I’m assuming you have already successfully installed Python, VS Code and the Python extension. Open the command palette (View > Command Palette, or ⌘+⇧+p on macOS, ⌃+⇧+p on Windows?), type “Jupyter” and select “Jupyter: Create New Blank Notebook” from the list of options. This should lead to a prompt to install ipykernel
. Follow the prompts to allow installation. (This may require entering your user password to authorise installation.) After this completes the print("hello world")
example should execute in the notebook.
5.1.3. Podcasts#
These are not explicitly aimed at beginners, but podcasts that I find informative on multiple levels and quite polished. Python Bytes, is a weekly 30’ podcast with an overview of interesting Python things. Test & Code is a longer format that covers all things related to testing code – a critical topic for scientists. Talk Python is a longer format interview of various individuals doing interesting things. Data science is increasingly covered by these podcasts.
5.1.4. Do you know any more?#
If you know of any more useful resources, please click the “Edit on GitHub” link above, add them to the appropriate section and make a pull request. For more information on this, read the How to Contribute section to learn how to become a contributor.