Simple Hello World Program In Python

Linux tutorials and code.
1 post Page 1 of 1
Contributors
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

helloworld.png
This hast to be no doubt the easiest, and fastest program you'll ever make on Linux, so first lets begin by opening a text editor. (Don't use a word processor, we must use a text editor!!!) Now put down the following source code.
Code: Select all
print "Hello, World!"
Now save it as helloworld.py (The .py extension identifies that this is a Python program)

Now open up your terminal and navigate to the desktop by putting down the following terminal command.
Code: Select all
cd Desktop
This will change the directory to our desktop.

Now lets test our program above by putting down the following terminal command. (NOTE: If we had any errors in our code they'll be automatically detected, but in our case we don't as seen in the final image below)
Code: Select all
python helloworld.py
You do not have the required permissions to view the files attached to this post.
1 post Page 1 of 1
Return to “Programming”