Welcome! This is your starting point for Python programming projects. Everything is set up and ready to go - you just need to start coding!
This is the easiest way to get started - no installation needed!
- Click the green "Code" button at the top of this page
- Click on the "Codespaces" tab
- Click "Create codespace on main"
- Wait about 1-2 minutes while your coding environment sets up
- You're ready to code! Everything is installed automatically.
That's it! Your environment is ready. All the tools you need are already installed.
Your coding environment includes these helpful tools:
- Python Test Explorer - See and run your tests with a visual interface (look for the beaker icon 🧪 in the sidebar)
- Python Debugger - Step through your code line by line to find bugs
- Spell Checker - Helps catch typos in your code and comments
- Auto-Formatting - Your code is automatically formatted to look professional when you save (using Black and Prettier)
- Type Checking - Alerts you to potential errors before you run your code
All AI assistance (like Copilot) is turned off so you can learn by doing!
Once your Codespace is ready:
- Look for the file called
main.pyin the file explorer on the left - Click on it to open it
- In the terminal at the bottom of the screen, type:
python main.py
- Press Enter
- You should see:
Hello, World!
Congratulations! You just ran your first Python program! 🎉
Tests help make sure your code works correctly. You can run tests in two ways:
- In the terminal, type:
pytest
- Press Enter
- You should see that 2 tests passed ✓
To see more details about what each test does:
pytest -v- Click the beaker/flask icon 🧪 in the left sidebar (Testing)
- You'll see a list of all your tests
- Click the
▶️ play button next to a test to run it - Green checkmarks ✓ mean the test passed!
- This is a great way to see which tests pass and which fail
Tip: The Test Explorer automatically discovers new tests when you save your files!
python-starter/
├── main.py # Your main program - start here!
├── tests/ # Tests to check if your code works
│ └── test_main.py # Example test file
├── requirements.txt # List of Python tools needed
└── README.md # This file (instructions)
- Open
main.py- This is where you'll write your code - Edit the code - Change the message or add new features
- Run it - Use
python main.pyto see your changes - Test it - Use
pytestto make sure everything works
- Ask your teacher or classmates
- Try the code and see what happens - It's okay to make mistakes!
- Read error messages carefully - They often tell you what's wrong
- Save your work often (it auto-saves, but you can also press
Ctrl+SorCmd+S) - Run your code frequently to catch mistakes early
- Start small and build up - don't try to write everything at once
- If something doesn't work, try reading the error message - it usually gives you a hint!
If you want to work on your own computer instead of Codespaces:
- Install Python from python.org
- Clone this repository:
git clone https://github.com/scottluskraa/python-starter.git cd python-starter - Install the required tools:
pip install -r requirements.txt
- Start coding!
But remember - using Codespaces is easier and requires no setup!