Step 1
Open any text editor (gedit,pico,vi,nano) then enter the following python script and save the file with .py extension.
#!/usr/bin/python
#Author : Jijo K Jose
print "\n------------------------------------\nChapter 3 - STDIN Input\n------------------------------------\n"
msg = raw_input("Enter Your Name : ")
age = input("Enter your age : ")
print "Your name is :" , msg
print "%s, your age is : %d" %(msg,age)
print "\n------------------------------------\n"
#END
Step 2
Change file permission to executable using chmod command.
Step 3
Execute the python file.
No comments:
Post a Comment