Choosing a Python IDE or Code Editor
You'll spend considerable time inside your editor, so choose one that fits your working style.
Common Options
- VS Code (Visual Studio Code)
- Free, lightweight, highly extensible
- Excellent for Python, web, and data projects
- PyCharm (Community or Professional)
- Full-featured Python IDE
- Powerful refactoring, debugging, testing support
- Other editors (Sublime Text, Vim, Neovim, etc.)
- Preferred by advanced users or for quick edits
For this course, we'll frequently reference VS Code and PyCharm. Still, any editor with Python support will suffice.
How to Decide
- If you're new to coding tools, VS Code is an excellent starting point.
- If you want a Python-only, all-in-one environment, consider PyCharm.
Setting Up and Customizing an IDE
Setup Python with VS Code
- Download and install from VS Code.
- Open VS Code → go to Extensions (square icon) → search for Python (by Microsoft) → Install.
- Open a folder for your projects: File → Open Folder….
- Create a new file
hello.py:
name = input("What is your name? ")
print(f"Hello, {name}! Welcome to Python.")
Run it using the Run Python File button or open the integrated terminal and run:
python hello.py
Example interaction:
What is your name? Alice
Hello, Alice! Welcome to Python.
Recommended VS Code Customizations
- Enable format on save:
- Settings → search
format on save→ check it.
- Settings → search
- Install useful extensions:
- Python, Pylance (intellisense), Black Formatter, or autopep8.
- Utilize the integrated terminal (View → Terminal) for a cohesive workspace.
Setup Python with PyCharm
- Download PyCharm Community from PyCharm.
- Install and launch PyCharm.
- Create a New Project → select Pure Python.
- PyCharm will automatically create a virtual environment (details are explained below).
- Right-click the project → New → Python File →
hello_pycharm.pyand use the same code as inhello.py. - Right-click the file → Run 'hello_pycharm'.
You’ll see the output in the Run tool window.
