Hello World

This should be the easiest thing for me to do. It took me 20 mins. For someone with my experience, that’s just not acceptable. Here’s what happened.

The book I refer is called “Learning Python” by Mark Lutz. ( the 3rd edition )
He mentions there a very simple application. Here is the source,

print “Hello World”
print 2 ** 100

That looks easy enough. I typed it out in Notepad++ and tried running it from the editor. It didn’t run. That meant 2 possiblities, either I had not configured Notepad++ correctly OR something was wrong with the python installed on my XP.

I decided to investigate the python angle. At my first attempt, I could not run the code even directly from the command line. -sigh- At least, now I knew where the problem was. I added the python intepretor to my environment variables but even then, things didn’t work.

What I did get was a facinating error message. It was a syntax error at the first line.

That baffeled me. Some googling around and I found the issue. Turns out that I’m using Python 3.0 and the syntax I was using is for the older releases. This page,
explained it to me.

I got my program to work now. The new code looks like this,

print(“Hello World”)
print(2 ** 100)

I’m thinking of looking for a new book now. Something updated for Python 3.0. Let’s see how I fare.


Beginning Python

I refer to the programming language, NOT the snake.

I just got a book about Python for myself and downloaded the Notepad++ text editor for windows. I’ll be doing my stuff on XP. I though, as a learning experience, I’ll share what I find out about Python here with you readers. I don’t know how long I’ll keep this up, but let’s just see where this leads, ok ?