A Step-by-Step Guide to Setup, Tools, GitHub, and Your First Project.
-
Install Python
- Download and install the latest version from python.org.
- During installation, make sure to check “Add Python to PATH”.
- Verify installation:
python --version
-
Install Git and Git Client Options
- Option A: Git via Command Line
- Install from git-scm.com.
- Verify installation:
git --version
- Configure your Git identity:
git config --global user.name "Your Name" git config --global user.email "[email protected]"
- Option B: Git in VSCode
- After installing Git, open your project in VSCode.
- Use the Source Control panel to stage, commit, and push code.
- Option C: Git with SourceTree (GUI)
- Download from sourcetreeapp.com.
- Connect your GitHub account and manage repositories with an intuitive UI.
- Option A: Git via Command Line
-
Install VSCode and Essential Extensions
- Download Visual Studio Code.
- Install these recommended extensions:
- Python (by Microsoft)
- Pylance
- GitHub Copilot (limited free usage, ChatGPT can be an alternative)
- Markdown All in One (for Markdown previews and shortcuts)
-
Create & Clone a GitHub Repository
- Go to GitHub and create a new repository.
- Clone the repository using:
- Command Line:
git clone https://github.com/username/my-python-project.git cd my-python-project - VSCode: Use Clone Repository from the Command Palette.
- SourceTree: Use the Clone/New button.
- Command Line:
- Create a new file
hello.py:print("Hello, Python world!")
- Create a
.gitignorefile (exclude folders like__pycache__/,.vscode/,.env). - Create a
README.mdfile to describe your project using Markdown.
-
Make Your First Commit
- Use Conventional Commits for clear commit messages.
- Example:
feat: add hello world script and README
- Example:
- Command Line:
git add hello.py .gitignore README.md git commit -m "feat: add hello world script, gitignore, and README" git push origin main - VSCode:
- Stage files in the Source Control panel.
- Enter a message using Conventional Commits format.
- Commit and push via the UI.
- SourceTree:
- Stage, commit, and push with GUI buttons.
- Verify the commit on GitHub.
- Use Conventional Commits for clear commit messages.
-
Learn Python Interactively
- Complete the free, hands-on course at learnpython.org.
- For Git basics, visit GitHub's Git Handbook.
-
Additional Tips
- Use GitHub Copilot for AI-powered code suggestions and to ask questions (free quota is limited).
- Keep a tidy
README.mdin each repo to document your project. - Use Markdown All in One in VSCode to preview documentation.
- Stick to Conventional Commits for meaningful version history.
- Push your code regularly and keep your repository up to date.
-
Practice: Build a Small Project
- Once you’ve learned about:
- variables, types, loops, conditions, functions, and basic data structures
- Choose a small project idea to apply what you’ve learned.
- Examples:
- A number guessing game
- A todo list in the console
- A temperature unit converter
- Examples:
- This reinforces learning and builds coding confidence.
- Push your project to GitHub and share it as a milestone!
- Once you’ve learned about: