Previous | Next

You are going to write your first Python program now. Let’s try this by writing a simple “hello” Python script, save it and execute it.

Saving .py file

Type the following using an editor. Save the file as Please note that all python script file will use .py as its file extension.

print "Hello, world!"
print "Welcome to askyb!"

Executing .py file

Browse to the directory where you keep the file. Then you can execute your script with the following command in Windows:


or Linux/Unix:

$ python

The get executed by python interpreter and you should see the following output:

Hello, world!
Welcome to askyb!

Previous | Next