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
Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Wednesday, 9 August 2017

Creation of File and Basic Programming

- 1 comment



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..

Python, What is Python?

- 34 comments

INTRODUCTION TO PYTHON LANGUAGE



In this section we will cover a brief introduction about Python and  syntax's for beginners

Python is a powerful high-level,interpreted,interactive,object-oriented,standalone programming language created in 1980's by Guido van Rossum.It's name came from MONTY PYTHON.
FEATURES OF PYTHON
  • It has simple easy-to-use syntax,making it the perfect language for someone trying to learn computer programming for the first time.
  • No compilation required, just run the script.
  • Easy maintanance,portability,scalability,readability,
  • It is an open source code.
  • Can be Extended to C(Cython),Java(Jython), .NET(Ironpython) 
  • Every memory allocation is done dynamically.
  • Supports a tonn of libraries and Universal languages.
  • Plays major role in Embedded system ie in automation.

what is an interpreter language?

An interpreter is a program that reads and executes code. This includes source code, pre-compiled code,and scripts. Common interpreters include Perl, Python, and Ruby interpreters, which execute Perl, Python, and Ruby code respectively.

COMPILERINTERPRETER

                                                                                       
C,C++,C#,JAVAPython,RUBY,Perl,JAVA Scripting
Will Generate Object code.No object code.
Whole source code will be treated as input.Line by line execution of source code.
Compile will create separate executable fileFile name itself is executable
Once the code is compiled successfully we can execute n number of timesEvery time statements will be executed
Compiler needs more memoryNeeds less memory with respect to compilers
Faster operation Slower compared to compilers



What is IDLE?
IDLE is Python’s Integrated Development and Learning Environment.
IDLE has the following features:
  • coded in 100% pure Python, using the tkinter GUI toolkit
  • cross-platform: works mostly the same on Windows, Unix, and Mac OS X
  • Python shell window (interactive interpreter) with colorizing of code input, output, and error messages
  • multi-window text editor with multiple undo, Python colorizing, smart indent, call tips, auto completion, and other features
  • search within any window, replace within editor windows, and search through multiple files (grep)
  • debugger with persistent breakpoints, stepping, and viewing of global and local namespaces
  • configuration, browsers, and other dialogs

In the next topics we will learn how to create a file and our first "Hello World!" Programming in Python..


 (Creation of File and Basic Programming)  Next >>