You have Python installed, an editor chosen, a virtual environment created, and a project folder started. The last step before diving into Python itself is to tie everything together into a clean daily workspace. A well-organized workspace means you spend less time on setup and more time writing code.
If any piece is missing, review the earlier guides: install Python, choose an editor, create a project, and set up a virtual environment.
Organize your project folders
Create one parent folder for all your Python work. A folder called projects or dev in your home directory works well:
~/projects/
number-guesser/
hello-python/
my-utils/Each project gets its own subfolder. This keeps things findable. Avoid scattering Python files across your desktop, Downloads, or Documents folders. When all projects live in one place, you always know where to look.
Inside each project, follow the project structure conventions: a main script, a requirements.txt, a README.md, and a .venv folder.
Configure your editor
Spend 10 minutes setting up your editor once, then stop tweaking. Here is what matters for a beginner Python workspace.
Set the Python interpreter per project. In VS Code, open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P), run "Python: Select Interpreter", and pick the one inside .venv. After this, the editor uses the virtual environment automatically for running code, linting, and IntelliSense.
Use spaces for indentation. Python requires consistent indentation. In VS Code, the default is spaces (4 per tab), which is correct. In PyCharm, it is also the default. Do not change this. In IDLE, spaces are the default.
Enable format-on-save (optional). In VS Code, search settings for "format on save" and enable it. Install the "Black Formatter" or "autopep8" extension if you want automatic formatting. This is optional but saves time as your code grows.
Turn on error highlighting. VS Code's Python extension highlights syntax errors and common mistakes in red as you type. Make sure the Python extension is installed and enabled. This catches typos before you even run the file.
Set up your terminal
The terminal is where you run Python scripts, install packages, and use git. A few habits make terminal work smoother.
Always check your environment first. When you open a terminal in a project folder, run:
python --versionThis confirms Python is available and shows which version. If you expect a virtual environment, also check that the terminal prompt shows (.venv) before the path.
Know your activation command. Write it down or memorize it for your operating system:
- macOS/Linux:
source .venv/bin/activate - Windows:
.venv\Scripts\activate
You will type this every time you start working on a project, unless your editor does it automatically.
Navigate quickly. These terminal commands save time:
cd ~/projects/my-project # go to a project
ls # list files (macOS/Linux)
dir # list files (Windows)
pwd # print current directory
code . # open current folder in VS CodeUse the up arrow. Press Up to cycle through previous commands. This is faster than retyping python main.py or python -m pip install.
Open a project and start coding
Here is the complete sequence to start a coding session. Do this every time until it becomes automatic:
- Open your editor.
- Open the project folder (File > Open Folder, or
code .from the terminal). - Open the integrated terminal in your editor (Ctrl+` or View > Terminal).
- Activate the virtual environment if the editor did not do it for you.
- Run
python --versionto confirm the environment. - Open your main
.pyfile and start writing code.
That is it. The entire setup takes under 30 seconds once you know the steps.
Keep a scratch file
Create a file called scratch.py in your project folder and keep it open while you work. Use it for quick experiments: testing a function, trying a new syntax, or checking how a library behaves.
# scratch.py -- quick experiments
# Test a function
print(len("hello"))
# Try a new library
from datetime import datetime
print(datetime.now())
# Check a value
x = [1, 2, 3]
print(x[0])Run it with a keyboard shortcut. When you figure something out, move the working code into your actual project file. Delete or comment out the scratch code so the file stays clean for the next experiment.
This habit is faster than opening a REPL for every small test, and it keeps your experiments in the same environment as your project.
Use the REPL for quick questions
The Python REPL (Read-Eval-Print Loop) is good for single-line checks. Open it by typing python (or python3) with no filename:
>>> len("hello")
5
>>> 3 ** 4
81Type exit() or press Ctrl+D (Ctrl+Z on Windows) to leave. The REPL is useful for checking syntax or trying a built-in function, but it has no file history. For anything longer than one or two lines, use scratch.py instead.
Folder conventions to follow
Use hyphens in folder names, not spaces. number-guesser not number guesser. Spaces in folder names cause problems in terminal commands unless you quote every path.
Use lowercase for file and folder names. main.py not Main.py. Some operating systems treat uppercase and lowercase filenames differently, and lowercase is the Python convention.
Keep .venv at the project root. Every project gets its own virtual environment folder. The dot prefix hides it on macOS and Linux. Never rename or move it. If something goes wrong with the environment, delete it and recreate it from requirements.txt.
Add .venv/ and __pycache__/ to .gitignore. If you use git, these should never be committed. Create a .gitignore file with these two lines and forget about them.
One editor, one terminal, one environment
Beginners sometimes open multiple editors, terminals, and Python versions simultaneously, then wonder why things do not work. Keep it simple:
- One editor open.
- One terminal open (the integrated terminal in your editor counts).
- One virtual environment active.
- One Python version confirmed.
When you hit a common error, this simple setup makes it easier to diagnose the problem. If you have three terminals open with different environments, troubleshooting becomes much harder.
When to stop customizing
It is tempting to spend hours picking a theme, installing extensions, configuring keyboard shortcuts, and tweaking terminal colors. Do not do this. The default settings in VS Code, PyCharm, or any modern editor are good enough for learning Python.
The point of a workspace is to remove friction, not to create a perfect aesthetic. If your code runs, your environment is fine. Spend your time on Python, not on wallpaper.
Ready to learn Python
Your workspace is set up. You can write scripts, run them, install packages, manage environments, and fix common problems. That is the entire tooling foundation.
Now move on to the language itself. Start with Python syntax and indentation, then work through comments, printing output, and getting user input. The Python Basics section builds on everything you have set up here.
Rune AI
Key Insights
Create a single projects folder in your home directory for all Python work; Configure your editor to use spaces for indentation and detect virtual environments; Always run python --version first in a new terminal to confirm the environment; Stop customizing once everything works and focus on learning Python.
Frequently Asked Questions
Where should I save my Python projects?
Should I use the terminal or my editor to run Python?
How many terminal windows should I have open?
What font and theme should I use?
Conclusion
A clean workspace removes friction. Organize your folders, configure one editor, set up your terminal, and then stop tweaking. The goal is to spend your mental energy on Python, not on your environment.
More in this topic
Create and Assign Variables in Python
Learn every way to create and assign variables in Python, from basic single assignment to expressions, type hints, and practical patterns beginners use every day.
Python Variable Naming Rules
Learn Python's variable naming rules, including allowed characters, reserved keywords, PEP 8 conventions, and how to choose names that make your code readable.
Python Variables Explained
Understand what Python variables are, how they store and reference data, and why Python's variable model is different from other programming languages.