Two ways to write Hello World program in Python



There are two ways to write Hello World program in Python.


First way is to use print statement like this:

 print("Hello World")  

When program is executed python shell will print very satisfying text message like this:


Nothing fancy.


Second Way is to use tkinter module and create basic GUI window with appropriate title like this:

 from tkinter import *  
 window = Tk()  
 window.title("Hello Python World")  
 window.mainloop()  


If you do this something magical happens! All of a sudden a window appears, your eyes are opening wide and you realize: I have created something great, I'm ... programmer!

And you run this simple script over and over again, checking it works every time, and magic is still there.




Few years later, magic is still there.

Every time.

This is the first post on this blog (after 300+ of them) about Python programming language.

I think it is appropriate to start with hello world.



*_*

Post a Comment

0 Comments