Python Setup & Git
Install Python 3, VS Code, venv, and Git — your entire development environment in one session.
Imagine 5 developers all editing the same app.py on WhatsApp. Priya adds login. Ravi adds payment. Ravi sends his file — Priya overwrites it. Ravi's payment feature is gone forever.
This happened at a Chennai startup in 2022 — they lost 3 weeks of work. Git is the solution. And Python's virtual environment (venv) means "it works on my machine" stops being an excuse forever.
⚙ What You Install Today (5–25 min)
Python 3.12 — The language. Run python --version to check.
VS Code — Editor. Add Python + Pylance extensions.
pip — Python's package manager. Like npm for JavaScript, Maven for Java.
venv — Virtual environment. Each project gets its own isolated Python world. No version conflicts.
💻 Live Demo — First Python Project (25–45 min)
# Step 1: Create project folder mkdir my-first-project cd my-first-project # Step 2: Create virtual environment (isolated Python for this project) python -m venv venv # Step 3: Activate it (Windows) venv\Scripts\activate # Step 4: Install a package (requests — for calling APIs) pip install requests # Step 5: Save your dependencies pip freeze > requirements.txt # like package.json for Python # Step 6: Git setup git init git add . git commit -m "first python project"
🐍 Your First Python Program — Hello, Real World
# hello.py — runs top to bottom, no main() needed name = "Priya" age = 21 # f-string: embed variables directly in the string print(f"Hello, {name}! You are {age} years old.") # Function — def, not public void def greet(name, age=18): # age has a default value return f"Hi {name}, you are {age}" print(greet("Ravi", 22)) print(greet("Anita")) # uses default age=18
- Create folder
my-portfolio, create and activate avenv - Create
main.py— print your name, city, and 3 goals for this internship using f-strings - Add a function
introduce(name, role)that returns a formatted introduction string - Run
git init, thengit add .thengit commit -m "first commit" - Create a GitHub repo and push it —
git push -u origin main - Show the instructor: Your GitHub repo URL
📄 Day 1 Cheat Sheet — Python Setup & Git
Virtual Environment
| python -m venv venv | Create venv |
| venv\Scripts\activate | Activate (Windows) |
| source venv/bin/activate | Activate (Mac/Linux) |
| pip install package | Install package |
| pip freeze > requirements.txt | Save deps |
| pip install -r requirements.txt | Restore deps |
Git Daily Workflow
| git pull | Get latest |
| git add . | Stage all |
| git commit -m "msg" | Save snapshot |
| git push | Upload |
| git status | What changed? |
| git log --oneline | History |
Python Basics
| name = "Priya" | String variable |
| age = 21 | Integer |
| f"Hello {name}" | f-string |
| def greet(name): | Function |
| return value | Return |
| print(x) | Output |
.gitignore for Python
| venv/ | Virtual env |
| __pycache__/ | Compiled files |
| *.pyc | Bytecode |
| .env | Secret keys |
| .DS_Store | Mac metadata |
| *.sqlite3 | Local DB file |