Python Notes Part 1
Python Notes Part 1
Python is a procedural, object oriented and functional language designed by Guido Van Rossum
in late 1980’s. This programming language covers the area of software development (Scions),
web development (Django), GUI development (Kivi) and scientific applications (Scipy). It is
designed in C. By nature, it is a high-level programming language that allows for the creation of
both simple as well as complex operations.
Features of Python
1. Easy to Code Python is a very developer-friendly language which means that anyone and
everyone can learn to code it in a couple of hours or days. As compared to other object-oriented
programming languages like Java, C, C++, and C#, Python is one of the easiest to learn.
2. Open Source and free - Python is an open-source programming language which means that
anyone can create and contribute to its development. Along with this Python is free to download
and use in any operating system, be it Windows, Mac or Linux.
4. Extensive Library - Python comes inbuilt with a large number of libraries that can be
imported at any instance and be used in a specific program. The presence of libraries also makes
sure that you don’t need to write all the code yourself and can import the same from those that
already exist in the libraries.
5. Python is Portable language - Python language is also a portable language. For example, if
we have python code for windows and if we want to run this code on other platforms such as
Linux, UNIX, and Mac then we do not need to change it, we can run this code on any platform.
And in cases where dynamic module reloading can be used, it's even possible to change
and reload parts of a running program without stopping it at all. Figure shows Python's
impact on the development cycle.
Because Python is interpreted, there's a rapid turnaround after program changes. And
because Python's parser is embedded in Python-based systems, it's easy to modify
programs at runtime. For example, we saw how GUI programs developed with Python
allow developers to change the code that handles a button press while the GUI remains
active; the effect of the code change may be observed immediately when the button is
pressed again. There's no need to stop and rebuild.
PYTHON IDE
Requirements for a Good Python Coding Environment
So what things do we really need in a coding environment? Feature lists vary from app to app,
but there are a core set of features that makes coding easier:
Save and reload code files - If an IDE or editor won’t let you save your work and reopen
everything later, in the same state it was in when you left, it’s not much of an IDE.
Run code from within the environment - Similarly, if you have to drop out of the editor to run
your Python code, then it’s not much more than a simple text editor.
Debugging support - Being able to step through your code as it runs is a core feature of all IDEs
and most good code editors.
Syntax highlighting - Being able to quickly spot keywords, variables, and symbols in your code
makes reading and understanding code much easier.
Automatic code formatting - Any editor or IDE worth its salt will recognize the colon at the
end of a while or for statement, and know the next line should be indented.
Text/Code Editor - Code editors are the lightweight tool that allows you to write and edit the
code with some features such as syntax highlighting and code formatting. It provided fewer
features than IDE.
After compilation, the bytecode is sent for execution to the PVM. The PVM is an interpreter that
runs the bytecode and is part of the Python system. The bytecode is platform-independent, but
PVM is specific to the target machine. The default implementation of the Python programming
language is CPython which is written in the C programming language. CPython compiles the
python source code into the bytecode, and this bytecode is then executed by the CPython virtual
machine.