Practical – 146 : Install, set up the environment & run Python
Here’s a clear and step-by-step guide on how to install, set up the environment, and run Python on your computer:
✅ 1. Install Python
🔹 For Windows:
- Go to the official Python website: https://www.python.org
- Click Downloads and choose Windows.
- Download the latest version (e.g., Python 3.12).
- Run the installer.
- ✔️ Important: Check the box that says “Add Python to PATH” before clicking Install Now.
- Wait for the installation to complete.
✅ 2. Set Up Environment
- Verify Python Installation:
python –version
or
python3 –version
- You can use IDLE (comes with Python), or install code editors like:
- VS Code (https://code.visualstudio.com)
- PyCharm
✅ 3. Run Python Code
🔹 Using Command Line (Terminal):
python
Then type:
print(“Hello, Python!”)
🔹 Using a Python File:
- Open any text editor (like Notepad or VS Code).
- Save the file as hello.py.
- Write this code:
- print(“Hello, World!”)
- Run it in terminal:
- python hello.py