Monday, April 15, 2013

Python


01.
03. 04. 05. 06. 07. 08. 09.

www.techtoney.blogspot.com

The Easiest Programming Language EVER! (Python).

Column 2

The Easiest Programming Language EVER! (Python).

Python 


Well, here I am writing this post about Programming with Python while listening to Taylor Swift’s super hit song “Red”. Believe me, programming with python is that easy.
If you have early programming experience, python is no matter for you. This article is targeted for beginners with no programming experience.  For those of you who have experience in C++ or VB, python is a sort of a ‘let down’ and this article is not necessary for you.
First of all, python is an excellent language and it is very simple to learn and understand the codes. Here is an example of a cool python source code.
name=input(“Please type your name: “)
print(“Hello {}, Welcome to python. Hope you will enjoy python.” .format(name))
The Output:
Please type your name: Wasee
Hello Wasee, Welcome to python. Hope you will enjoy python.
You see, how simple is a python code to write and understand. I think you are able to understand how this program worked by reading the source code. First, the program asked your name. You type your name (And Press ‘Enter’ ofcourse!).  And then it will print (Not through the printer, on the computer screen!) a welcome message with your name.
You should know that Python itself does not support Graphical User Interface (GUI). I mean, you cannot create executable (.exe) programs like MS Word or PowerPoint with python alone.  But, you can program the source code of the executable application in python and then very easily mask it using 3rd party software (For which you do not need to learn anything) and create GUI software like MS Word or PowerPoint. 
I am telling this at first because I learnt python thinking that I can start making cool software in a minute, but I discovered that I couldn’t. Nobody bothered to write a single line “HEY, You couldn’t actually create a GUI Software using Python alone!” in the beginning of their eBook.
But that doesn’t mean that python is bad. Programming with Python is fun and easy. Now in this post I am going to show you a few simple Python code.
What you need for programming with python: All you need to program with python is the python platform and an editor. Python is a free platform and you can download it from www.python.org. I use Komodo Edit for programming. It is also a free editor and you can download it from www.filehippo.com. Install both of them. Now the python platform is just for running python programs, so its pretty much of no use for programming but immensely useful for testing. For programming, just open komodo edit select file. From file select new and from there select file from template. Select python then. In the window that opens, you can write python codes.http://www.tipsoftech.com/2013/01/the-easiest-programming-language-ever.html
To save the codes, just press ctrl+S and save your document. One thing to notice always put .py after the name of the program or else it will not work. Below is a simple command.
The Print command:
print(“Hello, I am a programmer and I’m only 14!”)
The Output:
Hello, I am a programmer and I’m only 14!
You can print strings which is sentence, words, numbers, marks (That is, all the characters available in a keyboard!) using the print command. As you can see, for using print command you write print and type your string in (“  ”). This (“  ”) is absolutely important for every command in python. All strings in python must be written in (“  ”) otherwise python will not recognize it as a string and show an error.
After writing the code, save it as print.py. Open print.py and you can see the output. Your first program!
 By the way, I also created a python program called Wasee's All in One Calculator. You might want to download it and see the source code. Its quite simple actually.
 
Row 2 Cell 2

No comments: