Monday, November 25, 2013

First Python Script


Today I am writing about python basics. Python is a high level, scripting language. Linux terminal is used as a interpreter for python. Python is an object oriented programming language, it use very few punctuation for construction of syntax but follows indentation very strictly.

write basic python program:

  • 1. open a text file and write this code into it.
  • #!/usr/bin/python
    def main():
    print "Hello World!!!!!"
    if __name__=="__main__":
        main()

  • 2.Save this file as Hello_World.py
  • 3.Now go to the directory where you have saved the file through terminal and and type.
  • $python Hello_World.py

    No comments:

    Post a Comment