Skip to main content
Before you write a single line of Python, it pays to spend two minutes setting up a clean folder structure. VS Code is designed to work with folders rather than individual files — opening a folder gives the editor full context about your project, which it uses to provide better suggestions, smarter imports, and accurate error detection. A well-organised folder from the start also makes everything easier as your projects grow.

Create a projects folder

Start by creating a single parent folder on your computer that will hold all your Python work. This keeps everything in one predictable place.
1

Create your main projects folder

2

Create your first project folder

Inside PythonProjects, create a folder for this course:
Using lowercase letters and dashes (kebab-case) for folder names — like python-for-ai — is a convention shared by most Python projects and GitHub repositories. It avoids issues with spaces in paths and feels natural when you start working with the terminal.

Open the folder in VS Code

With your folder created, open it in VS Code using whichever method is most convenient: From VS Code:
  1. Click File → Open Folder (or press Ctrl/Cmd + O)
  2. Navigate to your python-for-ai folder and click Select Folder (Windows) or Open (macOS/Linux)
From your file manager:
  • Windows: Right-click the folder → Open with Code
  • macOS: Drag the folder onto the VS Code dock icon
  • Linux: Right-click the folder → Open with Code
From the terminal:

Understanding the VS Code interface

Once the folder is open, take a moment to orient yourself:
VS Code always operates on a folder, not just a file. This is why the Explorer panel shows your whole project tree. The editor uses this context to resolve imports, find related files, and understand your project layout.

Save as a workspace

A workspace file is a small bookmark that saves your project’s settings and lets you reopen everything with a single double-click.
1

Save the workspace

With your folder open, click File → Save Workspace As…
2

Name and place the file

Save it inside the python-for-ai folder and name it python-for-ai.code-workspace.
3

Test it

Close VS Code completely, then double-click the .code-workspace file in your file manager. VS Code should open directly to your project.
A workspace file remembers:
  • Which folders are part of your project
  • Your project-specific editor settings (overriding global settings)
  • Which files were open when you last closed the editor
  • Your debugging configuration
Create a shortcut to the .code-workspace file on your desktop or taskbar for instant access to your project every day.

Your project structure so far

After completing these steps, your folder looks like this:
That is all you need for now. As the course progresses, Python files, notebooks, and a virtual environment folder will be added here.

Your first Python file

Create and run your first Python program in this workspace.