"Python For Beginners"
- Get link
- X
- Other Apps
PYTHON FOR BEGINNERS
Python is an object-oriented language, which means that it can model real-world objects. It is also dynamically-typed because it carries out type-checking at runtime. It does so to make sure that the type of a construct matches what we expect in that context. The distinctive feature about Python is that it is an interpreted language. The Python IDLE (Integrated Development Environment) executes instructions a line at a time.
Etymology states that Guido van Rossum named it after the comedy group Monty Python. That is why the metasyntactic variables used here are ‘spam’ and ‘eggs’ instead of ‘foo’ and ‘bar’. Unlike as expected, it does not refer to the reptile species. A lot of implementations today run version 2.x, but the future belongs to Python 3.x. It is also called ‘Python 3000’ or ‘Py3K’. CPython, written in C, is the most common implementation of Python. It compiles a Python program into intermediate bytecode.
Apart from the constructs that Python provides, you can use the PyPI (Python Package Index). It is a repository of third-party modules, you can install it using a program called pip. Run the following command in Command Prompt:
pip install library_name
History of Python
Python programming language was conceived in the late 1980s and was named for the BBC TV show Monty Python’s Flying Circus. Guido van Rossum started python implementation at CWI in the Netherlands in December 1989. This was a successor to the ABC (programming language) which was capable of exception handling and interfacing with the Amoeba operating system.
On October 16, 2000, python 2.0 release was there and it had many major new features, that includes cycle-detecting garbage collector for memory management and support for Unicode.
Next version of Python 3.0 was released on December 3, 2008.
Now we know how Python came to the picture. Now let us jump to the Python Architecture in this Python Tutorial.
Python Architecture
This is the architecture of a CPython Compiler/Interpreter.
a. Parser
It uses the source code to generate an abstract syntax tree.
b. Compiler
It turns the abstract syntax tree into Python byte code.
c. Interpreter
It executes the code line by line.
Components of Python
a. Functions
A function is a collection of statements named into one. You can use it when you want to execute all those statements at a time. You can call it wherever you want in a program. A function may return a value.
b. Classes
As we discussed, Python is an object-oriented language. It supports classes and objects. A class is an abstract data type. In other words, it is a blueprint for an object of a certain kind. It holds no values.
c. Modules
A Python module is a collection of related classes and functions. We have modules for mathematical calculations, string manipulations, web programming, and many more.
d. Packages
A package is a collection of related modules. You can either import a package or create your own.
Now let us learn about the features of Python in this python tutorial. Based on these features you will be able to choose a programming language for your new project.
Features of Python
Python is one of the richest language, in this python tutorial we will discuss several features of python:
Python Tutorial – Features of Python
a. Easy
Python is very easy to learn and understand, using this python tutorial any beginner can understand basics of python.
b. Interpreted
It is interpreted(executed) line by line. This makes it easy to test and debug.
c. Object-Oriented
It supports classes and objects.
d. Free and Open Source
The language and its source code are available to the public for free, no need to buy a costly license.
e. Portable
You can run Python on Windows, Mac, Linux or any other platform.
f. GUI Programming
You can use it to develop a Graphical User Interface.
g. Large Library
Python provides you with a large standard library. You can use it to implement a variety of functions.
Read more about the features of Python in Detail in another of out Python tutorial on features of Python.
Now in This Python Tutorial let us see the Frameworks available in Python.
Frameworks available in Python
a. Django
This is a free and open-source framework that was written in Python and is the most common framework for Python. It allows you to create database-driven websites. It follows the DRY Principle (Don’t Repeat Yourself). Popular websites like Instagram, Mozilla, and Disqus make use of it.
b. Flask
Like Django, Flask is a web framework written in Python. It is a micro framework because it does not need certain libraries and tools. It also does not have form validation or a database abstraction layer. However, you can make use of extensions to add extra features.
c. Pyramid
Pyramid is another web framework. It is neither a mega-framework that would make decisions for you nor a micro-framework that wouldn’t force decisions. It gives you optimal liberty on your project.
d. Tornado
Another open-source web framework, it was written in Python. It is noted for its excellent performance and scalability.
e. Bottle
Like Flask, it is a micro-framework for Python. It is used for web development. Bottle is known for its speed, simplicity, and light-weight. A single file can run both Python 2.5+ and 3.x
f. web2py
Written in Python, web2py is another open source web framework. It emphasizes on rapid development, and follows an MVC architecture. MVC stands for Model View Controller.
g. NumPy
NumPy is an open-source framework for Python. It is used for scientific computing. It supports large multidimensional arrays and matrices, and functions to operate on them.
h. SciPy
SciPy is a Python library that you can use for scientific computing. It has modules for linear algebra, interpolation, fast Fourier transform, image processing, and many more. It uses a multidimensional array from the NumPy module.
i. Pylons
This is a deprecated framework, which means it is no longer recommended. It is a web framework, and is open source as well. It makes extensive use of third-party tools.
The advantages of Python are:
- Readability: The syntax of Python is readable and clear. The way it is organized, it imposes some order to programmers. Beginners and experts can easily understand the code and everyone can become quite productive in Python very rapidly. It is quite essential to mention that Python has lesser “dialects” than other popular languages, such as Perl.
- It Is Straightforward to Get Support: The community of Python always offers the good amount of support to the Python users. As we are already aware of the fact that Python code is freely accessible for everyone and therefore millions of developers all over the world are functioning hard to find bugs and craft patches to fix all those bugs. Several individuals are crafting fresh enhancements to the language and sending them for approval.
- Quick to Learn: The Python programming language is quite simple to learn as its source code resembles the pseudo code. Here, you don’t need to train yourself too much. You can get pretty quick results without actually wasting too much of your time. As soon as you start learning the Python language, you can carry out helpful coding almost immediately. After you gain some practice, your productivity is going to enhance a great deal. You can even design an object-oriented and high-level programming code. For small tasks, this is a great feature.
- Quick to Code: Python programming language offers quick feedback in a lot of ways. First of all, the programmer can easily skip several tasks that other languages want him to take. The cost of program maintenance comes down eventually. Python even permits a quick adaptation of the code. This language can simply be termed as a ready-to-run language, which just requires a simple code to be executed. Testing and playing around with your programming code becomes quite simple with Python. This language even offers a bottom up development style in which you can easily construct your applications by testing and importing crucial functions in the interpreter before you write the top-level code, which calls all the functions. Not many people know that the interpreter is easily extensible. It allows you to embed your favorite C code as a simple yet compiled extension module.
- Reusability: Python motivates the program reusability by carefully implementing packages and modules. A huge set of modules has already been innovated and is offered as the Standard Python Library, which is an essential part of the Python distribution. You can simply share the functionality between different programs just by breaking them into several modules and reusing them as components of other specific programs.
- Portability: Python not just runs on multiple systems, but it even has a similar interface on different platforms. The design of this language isn’t particularly attached to a certain operating system as it is written in portable ANSI C. It implies that you can easily write a Python program on a MAC operating system, test it on a Linux operating system, and upload it easily to a Windows system.
- Object-oriented Programming: Normally, scripting languages have different object-orientation support in the programming language. It works as a simple add-on. However, everything in this language is specially designed to be object oriented. You can get started with the programming process by making use of non-OO structures. Object oriented programming is not just simple, but quite beneficial as well.
Who uses Python?

This I guess is enough to understand the Big Picture of Python. Here are some free tutorials to start learning Python.
Thanks for your Time!
Keep learning!!!
References:
- Tutorial Point
- w3 school
- Data-fair Blogs
- Quora
- Image source - Google
- Get link
- X
- Other Apps
Comments
Post a Comment