Python Hello World on a Raspberry Pi

The next logical step after the last post is to created a python “Hello World” app on my Raspberry Pi.

Lets try Chat GPT this time, you have probably already figured out the Claude excels at these tasks.

We are going to reuse the same prompt as last time with a couple of changes:

Create a step by step guide, writing a “Hello World” program in Python, use IDLE, on my Raspberry Pi, assume the reader has zero knowledge of Python and or this project. I want to remote in via the built in VNC feature on the Rasberrian OS

One of the things you notice first is that the results do not come in that nifty right sidebar with a complete code download button out of the box.

I did ask for a nicer version.

🐍 Raspberry Pi Python “Hello World” Guide

Using VNC + IDLE (Beginner Friendly)


🎯 Goal

By the end of this guide, you will:

  • Connect to your Raspberry Pi remotely
  • Open Python’s editor (IDLE)
  • Write your first program
  • Run it and see:
    Hello, World!

🧰 What You Need

  • Raspberry Pi with Raspberry Pi OS
  • VNC enabled on the Pi
  • Another computer with VNC Viewer installed
  • IDLE available in the Raspberry Pi menu

🌐 Step 1: Connect to Your Raspberry Pi (VNC)

  1. Open VNC Viewer on your computer
  2. Enter your Pi’s IP address
  3. Click Connect
  4. Log in with your Pi username and password

✅ You should now see your Raspberry Pi desktop


🖥️ Step 2: Open Python (IDLE)

  1. Click the Raspberry Pi menu (top-left corner)
  2. Go to Programming
  3. Click IDLE or Python 3 (IDLE)

💡 A window called Python Shell will open — this is normal


📄 Step 3: Create a New Python File

  1. In the Python Shell window, click File
  2. Click New File

🪟 A blank editor window will appear


✍️ Step 4: Write Your First Program

Type this exactly:

print("Hello, World!")

⚠️ Be careful with:

  • Parentheses ( )
  • Quotation marks " "
  • Spelling of print

💾 Step 5: Save Your File

  1. Click File → Save
  2. Choose a location (Desktop is fine)
  3. Name the file:
hello.py
  1. Click Save

▶️ Step 6: Run the Program

  1. Click Run → Run Module
    (or press F5)

🎉 Step 7: See the Result

Look at the Python Shell window.

You should see:

Hello, World!

✅ Success! Your first program worked.


🧠 What Did You Just Do?

print("Hello, World!")
  • print → tells Python to display something
  • "Hello, World!" → the message

👉 Together: show this message on the screen


🧪 Try This Next

Change your message:

print("Hello from my Raspberry Pi!")

Save and run again.


⚠️ Common Mistakes

❌ Missing quotes

print(Hello, World!)

✅ Correct

print("Hello, World!")

❌ Misspelling print

prit("Hello")

✅ Correct

print("Hello")

❌ Forgot to save before running

✔ Always save before pressing F5


🛠️ Troubleshooting (If IDLE Is Missing)

1. Check Python

Open Terminal:

python3 --version

If you see a version → Python is installed ✔


2. Try launching IDLE manually

idle

or

idle3

3. If IDLE is not installed

sudo apt update
sudo apt install idle -y

Then try again:

idle

4. If it still doesn’t appear in the menu

sudo reboot

⚡ Quick Version (Cheat Sheet)

  1. Open VNC Viewer → connect to Pi
  2. Menu → Programming → IDLE
  3. File → New File
  4. Type:
print("Hello, World!")
  1. Save as hello.py
  2. Press F5
  3. Look for:
Hello, World!

🚀 What’s Next?

Try:

name = "Your Name"
print("Hello, " + name)


💡 You’ve just written your first Python program — nice work.

Success! We now have a hello world program written in Python on a Raspberry Pi!

Python Hello World

We have master creating HTML code using AI Chatbots!

Next is having it create code using Python.

I asked Gemini for the advantages of using Python when Vibe Coding and this was its response:

Python is the “native language” of vibe coding because it prioritizes intent over syntax. Here is why it works so well:

  • Readable & Concise: Python looks like English. Because it requires less “boilerplate” code, the AI can generate entire features in seconds without getting confused by its own length.
  • AI “Fluency”: AI models are trained more heavily on Python than almost any other language. This means the AI is less likely to hallucinate and more likely to give you working code on the first try.
  • Instant Feedback: Since Python is interpreted (not compiled), you can run it immediately, catch an error, and feed it back to the AI for a “vibe check” in a fast, continuous loop.
  • Infinite Plugins: If you want your app to do something specific—like analyze a PDF or generate an image—there is already a Python library for it. You’re just “plugging in” existing tools rather than building them from scratch.
  • Low Friction: You don’t have to worry about complex computer memory rules or semicolons. This lets you focus on what the app should do rather than how the computer processes it.

In short: Python stays out of the way, letting you and the AI focus entirely on the logic and the “vibe.”

It is easy, not as easy as html, and it is limited, creating .exe files is easier using Visual Studio and C# in my opionin.

So why did I go down the python path, well because I want to deploy on Raspberry PI devices, and python is perfect for that!

Let start on the windows desktop though, for ease of use.

Another thing I learned was how to prompt ai to give me all the info I need without knowing actually “How-To” .

Here is a prompt structure, with specific instructions that has served me well:

Create a step by step guide, writing a “Hello World” program in Python, use IDLE, on my Windows desktop pc, assume the reader has zero knowledge of Python and or this project.

The portion “Assume the reader has zero knowledge…” is critical.

Put that prompt into Claude, no need to create a project for something this simple! IDLE is the built in Python dev IDE.

Pretty impressiuve results, the only thing to do now is follow the instructions.

Odds are there will be errors in some of the codes, or hiccups.

Works as advertised!

As always click below to download the files I created.

Download Here