Table of Contents
Mac users, we’re back. Last time, we got Python 3 installed and running. Now we need a proper place to write code — and that place is VS Code.
Now, Mac already comes with a perfectly decent text editor called TextEdit. And just like how Mac comes with Python 2 pre-installed (which we’ve already talked about being outdated), TextEdit is… fine. But just fine. Writing code in it is like using a butter knife to chop vegetables. Does the job, sort of, but there’s clearly a better tool for this.
That better tool is VS Code. Let’s get it in.
What is VS Code, Really?
VS Code — Visual Studio Code — is a free code editor made by Microsoft. Yes, Microsoft. And yes, it works beautifully on Mac. It colours your code, catches errors as you type, lets you run your programs, and has thousands of extensions to make it do even more. It’s what most programmers use daily, regardless of what language they’re working in.
Light, fast, and free. Hard to argue with that.
Step 1 — Download VS Code
Go to code.visualstudio.com. The website will detect that you’re on a Mac and offer you the right download — a .zip file containing the VS Code app. Click the download button.
Official site only. Always.
Step 2 — Install the App
Once the .zip downloads, open it. It’ll automatically extract and give you the Visual Studio Code.app file.
Now here’s the one thing people miss — drag this .app file into your Applications folder.
Don’t just run it from Downloads. If you do, Mac will keep it in a temporary location and things get messy. Applications folder is its home. Drag it there.
After that, open it from Applications (or Spotlight — Cmd + Space, type VS Code). First launch, Mac might say it was downloaded from the internet and ask if you’re sure. Click Open. You’re sure.
Step 3 — Add VS Code to Your Terminal (Optional but Brilliant)
This is a small step that saves a lot of time. It lets you type code . in Terminal and instantly open any folder in VS Code. Very handy.
Here’s how to set it up:
- Open VS Code
- Press Cmd + Shift + P to open the Command Palette
- Type Shell Command and select “Install code command in PATH”
Done. Now open a new Terminal window and type code . inside any folder. VS Code will open it instantly. Once you start using this, you won’t stop.
Step 4 — Install the Python Extension
Just like on Windows, VS Code needs to know you’re working with Python. Click the Extensions icon on the left sidebar — it looks like four little squares. Search for Python, and install the first result — the official one by Microsoft.
This extension is what makes VS Code aware of your Python installation. It enables error detection, auto-suggestions, and running Python files right inside VS Code. One install, a lot of benefit.
Step 5 — Test Everything Together
Let’s do a quick sanity check. In VS Code, go to File > New File, save it as hello.py, and type:
print("Hello from VS Code on Mac!")
Hit the Run button (top right triangle), or press Ctrl + F5. A terminal will open at the bottom of VS Code and print:
Hello from VS Code on Mac!
If you see that — Python is installed, VS Code is set up, everything’s talking to each other. Now you can look into coding stuff.
Quick Recap
- Download VS Code from code.visualstudio.com (.zip for Mac)
- Drag the .app to your Applications folder — don’t skip this
- Set up the “code .” terminal command via the Command Palette
- Install the Python extension from the Extensions tab
- Run a .py file to confirm everything works
Setup is complete. Whether you’re on Windows or Mac, you now have Python installed and VS Code ready to go. From here, we actually get to — writing real code, understanding how it thinks, and building things.
Rome was not built in a day, next topics will be continuous for min 20 minutes. So when you’re ready, hop in.
