GitHub Codespaces + VS Code: Hello World Python

Run Python without installing anything on your laptop

GitHub Codespaces lets you open a complete development environment directly in your browser. It feels like VS Code, but runs on GitHubโ€™s cloud machines.

For beginners, classrooms.

๐Ÿ‘‰ GitHub Links GitHub repository GitHub Codespace

Step 1: Create a GitHub Repository

  1. Login to GitHub
  2. Click New Repository
  3. Name it python-codespace-hello
  4. Select Add README
  5. Click Create repository
๐Ÿ“ทโ€“ Creating a new GitHub repository Create repo placeholder Create repo placeholder Create repo placeholder Create repo placeholder
๐Ÿ“Ž Dummy link: How to create a GitHub repository

Step 2: Create a Codespace

  1. Open your repository on GitHub
  2. Click the green <> Code button
  3. Switch to the Codespaces tab
  4. Click Create codespace on main
๐Ÿ“ท โ€“ Create Codespace button Create codespace placeholder Create codespace placeholder Create codespace placeholder Create codespace placeholder
๐Ÿ“Ž Dummy link: Creating a GitHub Codespace

Step 3: Create hello.py

Inside Codespaces, create a new file named hello.py and write your first Python program:

print("Hello, World! ๐Ÿ‘‹")
print("Welcome to Python on GitHub Codespaces")
๐Ÿ“ท Dummy Image โ€“ Writing hello.py in VS Code hello.py placeholder hello.py placeholder hello.py placeholder hello.py placeholder hello.py placeholder hello.py placeholder hello.py placeholder

Step 4: Run the Program

Open the terminal and run:

python hello.py
๐Ÿ“ท Dummy Image โ€“ Terminal output Hello World hello.py placeholder
If python doesnโ€™t work, try:
python3 hello.py

Whatโ€™s Next?

  • Input & Output programs
  • Conditions and loops
  • Mini Python projects
  • NLP and libraries (NLTK, pandas)