How to Set Up a Python Development Environment (VS Code + Git)

Python & Web Dev Basics (2 Part Series)

1 Why Python is the Best Programming Language for Beginners
2 How to Set Up a Python Development Environment (VS Code + Git)

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:

  1. Download and run the installer.

  2. Check “Add Python to PATH” before clicking “Install”.

  3. 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

Enter fullscreen mode Exit fullscreen mode

On Linux (Debian/Ubuntu):

sudo apt install python3

Enter fullscreen mode Exit fullscreen mode

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:

  1. Open VS Code and install the Python Extension

  2. Press Ctrl + Shift + P → Type Python: Select Interpreter → Choose Python 3.x

  3. 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 “youremail@example.com

Check if Git is Installed:

git --version

Enter fullscreen mode Exit fullscreen mode

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!")

Enter fullscreen mode Exit fullscreen mode

Run the script by clicking Run ▶️ or using the terminal:

python hello.py

Enter fullscreen mode Exit fullscreen mode

Congrats! You’ve successfully set up Python, VS Code, and Git!

Python & Web Dev Basics (2 Part Series)

1 Why Python is the Best Programming Language for Beginners
2 How to Set Up a Python Development Environment (VS Code + Git)

原文链接:How to Set Up a Python Development Environment (VS Code + Git)

© 版权声明
THE END
喜欢就支持一下吧
点赞12 分享
Have faith in your dreams and someday your rainbow will come smiling through.
请对梦想充满信心,总有一天属于你的彩虹会在天空微笑
评论 抢沙发

请登录后发表评论

    暂无评论内容