Jump to content

Introduction to Python Programming/Introduction

From Wikibooks, open books for an open world

Python is free and open source software that is available at free of cost to the end user where the end user can develop, modify, reengineer, and distribute versions of the software under the general public license which is at the disposal of other end users.

Python is dynamic and strongly typed language. Variables are assigned the types on their first initialization of the value i.e., variables are assigned dynamically during run time instead of having to declare them first and use them later as done in the statically typed languages such as C, C++, Java. Languages such as C, C++, Java, etc require that variables are first declared, initialized and then utilized within the programs that they are run, in contrast to Python. This holds true for all things including parameters, functions, methods, and classes. Python allows for object oriented programming just like Java, C, C++, etc. Python tracks all the variables at run time and reports any discrepancies within code, variables the moment it senses it.

There is no need for extra curly braces, semicolons, the need to compile the program and then run the program as one needs to be do in C, C++, Java programming. Python interpreter tracks the errors of the code blocks at run time and throws up error the moment it senses an error opposed to the typical statically typed languages where error checking happens at compile time. With statically typed languages, it’s a pain staking process wherein one needs to type out the entire code block and then compile it to check for any errors.

Python offers a shell interpreter where small pieces of code can be tested without having to write out entire pieces of code. The shell interpreter saves a lot of time in testing individual blocks of code allowing for simultaneous checking of code, testing it, and debugging it.

Python files can be imported easily into the shell interpreter with a single command, allowing access to the methods, classes, and instances of the Python modules which allows for greater reusability of code.

Python provides inbuilt testing modules that allow the end user to develop testing code units resulting in Test Driven Development (TDD). This flexibility allows user to not only test, debug code while it is being written, but allows test for errors the moment the code gets written. All types of testing, including functional testing, black box testing, extra can be performed easily.

Python programming language is suited for both front end development, and back end processes. Python is suited for a myriad purposes including but not limited to data processing, Graphical User Interfaces (GUI), running background processes, real time processing of data, running numerical simulations.

Further Python allows for development within specific extensions that can be imported making Python flexible for a variety of applications. The applications of Python as a programming languages used to develop applications are endless and are left to the user’s imagination to come with innovative applications.

Some examples of extensions of Python that allow extra capabilities are Numpy that offer matlab type of capabilities providing for array operations, matplotlib that is the Python library for plotting high quality graphs, and pandas that provides high performance, easy to use data structures, and data analysis tools. Stunning visualizations can also be made from real data.

This book on Python is intended to be primer allowing the user to learn the basics of Python programming without getting into the intricate details of the language or the benefits it offers. The benefits become aware to the user as and when the user learns the language.

While I have exalted the features of Python programming, there are some downsides associated with Python programming. One of the major downside is that Python is that it is not memory optimized like C, or C++ which may lead to extra run time problems or increased execution times. However, the features of Python provide for attractive propositions than any other existing languages can offer and hence is the most preferred languages for a variety of applications