DEV Community

Cover image for [10 | PY 01] Python Setup for Beginners: Start Coding in Minutes
Anik Paul
Anik Paul

Posted on

[10 | PY 01] Python Setup for Beginners: Start Coding in Minutes

Are you ready to dive into Python but not sure how to set everything up? Whether you're completely new or just switching machines, this beginner-friendly guide will walk you through the entire setup process - from installing Python to writing and running your very first Python script using Visual Studio Code (VS Code).

Let’s get started step-by-step. By the end of this guide, you’ll have everything ready to start coding in Python.


✅ Step 1: Install Python on Your System

Python is an interpreted language, which means:

  1. It first compiles your code into bytecode.
  2. Then executes it using the Python Virtual Machine.

So, we need to install the Python interpreter first.

🔗 Download Python

  1. Go to the official Python website: https://www.python.org/downloads
  2. Click on the latest stable version (e.g., Python 3.13.x).
  3. Run the downloaded installer.

⚠️ IMPORTANT: Add Python to PATH

During installation, check the box that says:

Add Python to PATH

This is crucial, as it allows you to use Python from the terminal (Command Prompt or VS Code Terminal).

Once installed, you can verify Python installation by opening your terminal and typing:

python --version
Enter fullscreen mode Exit fullscreen mode

If installed correctly, you’ll see something like:

Python 3.13.5
Enter fullscreen mode Exit fullscreen mode

✅ Step 2: Set Up VS Code (Your Python IDE)

While there are many IDEs like PyCharm, VS Code (Visual Studio Code) is lightweight, fast, and highly customizable - perfect for beginners.

🔽 Download and Install VS Code

🧩 Install Python Extension for VS Code

Once you open VS Code:

  1. Go to the Extensions tab (left sidebar or press Ctrl + Shift + X).
  2. Search for "Python" (by Microsoft).
  3. Click Install.

This extension provides:

  • Syntax highlighting
  • IntelliSense (auto-suggestions)
  • Code linting
  • Code formatting
  • Python interpreter selection
  • Integrated terminal support

✅ Step 3: Configure the Python Interpreter in VS Code

After installing the Python extension:

  1. Open the Command Palette (Ctrl + Shift + P).
  2. Type and select: Python: Select Interpreter
  3. Choose the latest installed version of Python.

💡 Tip: If you don’t see the interpreter, restart VS Code or check if Python is added to the PATH properly.


✅ Step 4: Write and Run Your First Python Script

Let’s create a simple Python file and run it.

📝 Create Your First File

  1. Open a folder in VS Code (or create a new one).
  2. Create a new file named: main.py

Paste this code:

# This is my first Python program
print('I like Biryani!')
Enter fullscreen mode Exit fullscreen mode

▶️ Run the Script

  • Option 1: Right-click inside the file and click "Run Python File in Terminal"
  • Option 2: Use the shortcut Ctrl + Alt + N if you have the Code Runner extension installed.

You should see the output:

I like Biryani!
Enter fullscreen mode Exit fullscreen mode

🎉 Congrats! You just wrote and executed your first Python program!


✅ Step 5: Bonus – Useful VS Code Extensions for Python Projects

Here are some handy extensions that’ll make your Python coding experience smoother:

Extension Name Purpose
Python (Microsoft) Required for all Python functionality
Code Runner Run code quickly from editor
Pylance Fast IntelliSense and error checking
Jupyter Work with .ipynb notebooks (optional)
autoDocstring Generate docstrings automatically
Black Formatter Format code with opinionated style

You can install these from the Extensions tab just like the Python extension.


🛠️ Optional: Set Up a Virtual Environment (Best Practice)

For real projects, it's a best practice to use a virtual environment so your dependencies don’t conflict across projects.

From your project folder, run this in terminal:

python -m venv venv
Enter fullscreen mode Exit fullscreen mode

Then activate it:

  • On Windows:
  venv\Scripts\activate
Enter fullscreen mode Exit fullscreen mode
  • On macOS/Linux:
  source venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

You'll now see (venv) in your terminal - you're inside the virtual environment.


🚀 Recap

Here’s what you’ve done:

  • ✅ Installed Python and added it to PATH
  • ✅ Installed and configured VS Code
  • ✅ Installed Python extension and selected interpreter
  • ✅ Created and ran your first Python script
  • ✅ Learned about virtual environments and useful extensions

You're now fully set up to learn and build Python projects!


📬 Let’s Connect
🌐 Portfolio: paulanik.com
💼 LinkedIn: Anik Paul
🐙 GitHub: anikpaul99
📩 Email: hello@paulanik.com

Top comments (2)

Collapse
 
barby_ky_7d2b7a3e37329529 profile image
Barby Ky

sos the code is not working

Collapse
 
anikpaul profile image
Anik Paul

Hi! Thanks for reading the article. Could you share a bit more about what’s not working?

  • What error message are you seeing?
  • Which operating system are you on (Windows, macOS, Linux)?
  • Did you install Python and add it to PATH as shown in Step 1? Once I know these details, I can help you get it running. 😊