Introdução ao Python, IDLE e VS Code [Curso de Python: Aula 2]

3 min read 3 hours ago
Published on Dec 29, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial provides a comprehensive guide to getting started with Python programming using IDLE and Visual Studio Code (VS Code). Whether you're a complete beginner or just looking to enhance your skills, this step-by-step guide will help you set up your environment and write your first Python code.

Step 1: Installing Python

  1. Download Python:

    • Go to the official Python website at python.org.
    • Click on the "Downloads" section and select the version suitable for your operating system (Windows, macOS, or Linux).
  2. Install Python:

    • Run the downloaded installer.
    • Make sure to check the box that says "Add Python to PATH" during installation.
    • Follow the prompts to complete the installation.

Step 2: Setting Up IDLE

  1. Open IDLE:

    • After installation, search for IDLE in your applications or programs list.
    • Launch IDLE, which is the integrated development environment that comes with Python.
  2. Create a New File:

    • In IDLE, select File from the menu, then click on New File.
    • This opens a new window where you can write your Python code.
  3. Write Your First Program:

    • Type the following code in the new file:
      print("Hello, World!")
      
  4. Run Your Program:

    • Save your file with a .py extension (e.g., hello.py).
    • Press F5 or select Run from the menu and click Run Module to execute your code.

Step 3: Setting Up Visual Studio Code

  1. Download Visual Studio Code:

    • Visit the official VS Code website at code.visualstudio.com.
    • Download the version compatible with your operating system.
  2. Install Visual Studio Code:

    • Run the installer and follow the installation prompts.
    • Open VS Code after installation.
  3. Install Python Extension:

    • Open VS Code and go to the Extensions view by clicking on the Extensions icon in the Activity Bar or pressing Ctrl+Shift+X.
    • Search for "Python" and install the official Python extension provided by Microsoft.
  4. Create a New Python File:

    • Click on File, then New File, and save it with a .py extension (e.g., hello_vscode.py).
  5. Write and Run Your Code:

    • Write the same code:
      print("Hello, World!")
      
    • To run your code, open the terminal in VS Code by clicking on Terminal in the menu and selecting New Terminal.
    • Type the following command and press Enter:
      python hello_vscode.py
      

Conclusion

You have successfully installed Python, set up both IDLE and Visual Studio Code, and run your first Python program. As you progress, consider exploring additional resources, such as online courses for deeper understanding and practice. Happy coding!