Blogger Themes

Search This Blog

www.embeddedstudy.com | Copyright © 2017 | All Rights Reserved | Nithin Pradeep . Theme images by Storman. Powered by Blogger.

Popular KOZHI

Sponsor

Download

Blogger Tricks

FEATURED

What is an Embedded System?

An embedded system is a combination of hardware and software that is designed to carry out a certain task or tasks, meaning it has a s...

JOIN THE TEAM

Popular Posts

Wikipedia

Search results

Search This Blog

Social

More Links

Social

ad

ads

Wednesday, 9 August 2017

Creation of File and Basic Programming



In the previous topics we have seen the salient features of python,I this tutorial we will see the basic "Hello World!" programming in python on linux.

STEPS


  1. Open the terminal (ctrl+alt+T)
  2. After installing the latest version of python type      vi filename.py                                             eg:- vi p1.py   (create a file)
  3. Type    #!/usr/bin/python   (this is called as shebang statement-this is for making the interpreter to realize which statement it is executing).
  4. write   print ("Hello world!")
  5. don't put semicolon at the end of program like in C.

if we want to check where python is installed 
which python  or whereis python

To display Universal language in python:-
  1. Go to www.jrgraphix.net
  2. Go to code tab-> unicode character Table
  3. Choose a language
  4. ie if in Malayalam language i want to write my name note the corresponding code ie to write "NITHIN" 
  5. print (u"\u0D28" + u"\u0D3F" +u"\u0D24" +u"\u0D3F" +u"\u0D7B")
  6. To run the file type   python    p1.c

Commenting:

#  for single line comment
eg    #hello
''' for multiline comment
eg    ''' hello how
            are you '''


Difference between  '  ''  '''  (single double and triple quotes)

all are same i.e used to print string but:
('  single quote)- e.g 'today"s date'  will print today"s date
(" double quote)- e.g "today's date"  will print today's date
(''' Triple quote)- e.g '''today's date
                                     is 16/10/2017'''                  for line continuation.

SAMPLE:


In th next topics we will cover Basic Data Types in Python..
Thank you..

1 on: "Creation of File and Basic Programming"