๐ How to Set Up a Python Development Environment (VS Code + Git)
So, youโve decided to learn Pythonโgreat choice! ๐ Now, letโs set up a proper coding environment to write, test, and manage Python projects efficiently.
Today, weโll cover:
โ
Installing Python
โ
Setting up VS Code for Python
โ
Installing Git for version control
โ
Running your first Python script
Letโs get started!๐
1๏ธโฃ Install Python
First, you need to install Python on your system.
๐น Download Python from the official site:
๐ Python Official Download
๐น For Windows:
Download and run the installer.
Check "Add Python to PATH" before clicking "Install".
Open Command Prompt and type:
python --version
If it shows the Python version, youโre good to go! โ
๐น For Mac/Linux:
Use Homebrew on Mac:
brew install python3
On Linux (Debian/Ubuntu):
sudo apt install python3
2๏ธโฃ Install VS Code (Visual Studio Code)
Why VS Code?
โ๏ธ Lightweight & Fast
โ๏ธ Supports Python Extensions
โ๏ธ Built-in Terminal & Git Support
๐น Download & install VS Code:
๐ VS Code Official Site
๐น Set Up Python in VS Code:
Open VS Code and install the Python Extension
Press Ctrl + Shift + P โ Type Python: Select Interpreter โ Choose Python 3.x
Open a folder, create a .py file, and start coding!
3๏ธโฃ Install & Set Up Git for Version Control
Version control helps you track changes in your code. Git is the most popular tool for this!
๐น Download Git:
๐ Git Official Site
๐น Basic Git Setup (After Installation)
Open a terminal and set up your identity:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
๐น Check if Git is Installed:
git --version
If you see the version number, Git is ready! โ
4๏ธโฃ Run Your First Python Script
Now, letโs write and run your first Python script in VS Code.
๐น Open VS Code, create a file named hello.py
๐น Write this simple code:
print("Hello, World! Welcome to Python Development!")
๐น Run the script by clicking Run โถ๏ธ or using the terminal:
python hello.py
Congrats! ๐ Youโve successfully set up Python, VS Code, and Git!
Top comments (0)