Creating a GitHub Codespace for a Python Project

Part 1: Use the Starter Codespace

  1. Go to the Python Codespace at Informatics FYI

Part 2: Run the Codespace

  1. Click the “Code” button, and then click the “Codespaces” tab.
  2. Click the “Create Codespace on Main” button. GitHub will create a Codespace, which will take a while.
  3. Once the Codespace is ready, it will open in a new browser tab with an integrated development environment (IDE) powered by Visual Studio Code.

Part 3: Install libraries in the Codespace

  1. Open the terminal in the Codespace by clicking “Terminal” in the top menu and selecting “New Terminal.”
  2. If your project has a requirements.txt file, install the required packages using the following command: pip install -r requirements.txt

Part 4: Experiment with Python

  1. Open and attempt to run the script. You can also run the script Jupyter notebook-style by executing cells.

Part 5: Shut down the Codespace

  1. You have a free limit of around 60 hours per month.
  2. If you have a Pro account, or a credit card on file, to avoid charges, set the spending limit in the settings of your account.
  3. Always Stop the Codespace when you are done. You can do this by clicking on the bottom left hand corner of the editor where it says, “Codespaces,” and select “Stop Codespace.”

You now have a fully functional GitHub Codespace for your Python project. You can use the browser-based IDE to write, run, and debug your Python code, as well as commit and push changes to the remote repository. If you continue using the codespace, it is recommended to create a fork of the repository so that you can save changes to your scripts! You can see how to do this in the video.

In order to prevent bot spam, please answer the following question with the word informatics.

About Informatics FYI

Hello, I'm Chris, and I am an Informaticist. Join me as I share my experiences and perspectives on the field of Informatics, and how you can bring together people, technology and information to serve others. Together we will explore a digital landscape that can be as vast as our own planet, with the same wonders, experiences, and hazards you might encounter while traveling the world.

Whether you are curious about the field, starting a career, or growing in your day to day work, I hope you enjoy Informatics FYI. As this journey progresses, we will join together on quests to apply informatics to public problems.