Skip to main content

Features of Python

a) Simple and easy-to-learn: Python is a Simple language with few keywords, simple structure and it's syntax is also clearly defined. This makes Python a beginner's language.

b) Interpreted and Interactive: Python is processed at runtime by the interpreter. We need not compile the Program before executing it. The Python prompt Interact with the interpreter to interpret the Programs that you have written. Python has an option namely interactive mode which allows interactive testing and debugging of code.

c) Object-Oriented: Python supports Object Oriented Programming (OOP) concepts that encapsulate code within objects. All concepts in OOPs like data hiding, operator overloading, inheritance etc. can be well written in Python. It supports functional as well as structured Programming.

d) Portable: Python can run on a wide variety of hardware and software platforms and has the same interface on all platforms. All variants of Windows, Unix, Linux and Macintosh are to name a few.

e) Scalable: Python provides a better structure and support for large Programs than shell scripting. It can be used as a scripting language or can be compiled to bytecode (intermediate code that is platform independent) for building large applications.

f) Extendable: You can add low-level modules to the Python interpreter. These modules enable Programmers to add to or customize their tools to be more efficient. It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

g) Dynamic: Python provides very high-level dynamic data types and supports dynamic type checking. It also supports automatic garbage collection.

h) GUI Programming and Databases: Python supports GUI applications that can be created and ported to many libraries and windows systems, such as Windows Microsoft Foundation Classes (MFC), Macintosh, and the X Window system of Unix. Python also provides interfaces to all major commercial databases.

i) Broad Standard Library: Python’s library is portable and cross platform compatible on UNIX, Linux, Windows and Macintosh. This helps in the support and development of a wide range of applications from simple text processing to browsers and complex games.

How to Run Python 

There are three different ways to start Python.

a) Using interactive Interpreter 

You can start Python from Unix, DOS, or any other system that provides you a command-line interpreter or shell window. Get into the command line of Python. For Unix/Linux, you can get into interactive mode by typing $python or python%. For Windows/Dos it is C : >python.

Invoking the interpreter without passing a script file as a parameter brings up the following prompt

$ python 
Python 2.7.10 (default, $ep 27 2015, 18:11:38) [GCC 5.1.1 20150422 (Red Hat 5.1.1-1)] on linux2 
Type “help”, “Copyright”, “credits” or “license” for more information. 
>>> 
Type the following text at the Python prompt and press the Enter Key:

>>> print “Programming in Python!” 
The result will be as given below

Programming in Python! >>> 

b) Script from the Command Line 

This method invokes the interpreter with a script parameter which begins the execution of the script and continues until the script is finished. When the script is finished, the Interpreter is no longer active. A Python script can be executed at command line by invoking the interpreter on your application, follows.

For Unix/Linux it is
$python script .py or python% script . py 
For Windows/Dos it is
C:>python script. py

Let us write a simple Python Program In a script. Python files have extension .py Type the foilowin source code In a first.py file.

print “Programming in Python!” 

Now, try to run this Program as follows.

$ python hrst.py 

This produces the following result:

Programming in Python! 

c) integrated Development Environment 

You can run Python from a Graphical User interface (GUI) environment as well, if you have a GUI application on your system that supports Python. IDLE is the Integrated Development Environment (iDE) for UNIX and PythonWin is the first Windows interface for Python.

Comments

Popular posts from this blog

8051 Simple Programs

Sum of 8-bit Numbers Stored in Memory Here  we will discuss about 8051 programs but we can't discuss about all of the 8051 instructions. For programming 8051 we should know about assembler directives as well as instruction set. Click  here to download Atmel c51 user guide that will discuss about 8051(c51 family microcontroller) instruction set, assembler directives, c51 cross assembler from Atmel.  Program ORG 00H MOV R0,#50H   ; get memory location in memory pointer R0 MOV R1,#51H   ; get memory location on memory pointer register R1 MOV A,@R0       ; get content of memory location 50H to accumulator ADD A,@R1        ; add content of A with content of memory location 51H and store result in A MOV R0,#52H    ; get 52H to memory pointer R0 MOV@R0,A         ; copy content of A to memory location 52H END Add 16-bit Numbers ...

ATMEGA-32 Pin-out Diagram

Overview The Atmel®AVR®ATmega32 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega32 achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed. AVR spin-out diagrams Block diagram:- The Atmel®AVR®AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers. The ATmega32 provides the following features: 32Kbytes of In-System Programmable Flash Program memory with Read-While-Write capabilities, 1024bytes EEPROM, 2Kbyte SRAM, 32 general purpose I/O ...

Even and Odd Memory Banks

The 8086 microprocessor uses a 20-bit address to access memory. With 20-bit address the processor can generate 2 20 = 1 Mega address. The basic memory word size of the memories used in the 8086 system is 8-bit or 1-byte (i.e., in one memory location an 8-bit binary information can be stored). Hence, the physical memory space of the 8086 is 1Mb (1 Mega-byte). For the programmer, the 8086 memory address space is a sequence of one mega-byte in which one location stores an 8-bit binary code/data and two consecutive locations store 16-bit binary code/data. But physically (i.e., in the hardware), the 1Mb memory space is divided into two banks of 512kb (512kb + 512kb = 1Mb). The two memory banks are called Even (or Lower) bank and Odd (or Upper) bank. The organization of even and odd memory banks in the 8086-based system is shown in Figure. The 8086-based system will have two sets of memory IC's. One set for even bank and another set for odd bank. The data lines D 0 -D 7 are conne...