What Is Python.

What is Python?

Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.
It is used for:
  • web development (server-side),
  • software development,
  • mathematics,
  • system scripting.

What can Python do?

  • Python can be used on a server to create web applications.
  • Python can be used alongside software to create workflows.
  • Python can connect to database systems. It can also read and modify files.
  • Python can be used to handle big data and perform complex mathematics.
  • Python can be used for rapid prototyping, or for production-ready software development.

Why Python?

  • Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
  • Python has a simple syntax similar to the English language.
  • Python has syntax that allows developers to write programs with fewer lines than some other programming languages.
  • Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick.
  • Python can be treated in a procedural way, an object-orientated way or a functional way.

Good to know

  • The most recent major version of Python is Python 3, which we shall be using in this tutorial. However, Python 2, although not being updated with anything other than security updates, is still quite popular.
  • In this tutorial Python will be written in a text editor. It is possible to write Python in an Integrated Development Environment, such as Thonny, Pycharm, Netbeans or Eclipse which are particularly useful when managing larger collections of Python files.

Python Syntax compared to other programming languages

  • Python was designed for readability, and has some similarities to the English language with influence from mathematics.
  • Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses.
  • Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly-brackets for this purpose.
  • Benefits of Learning Python


    There are many benefits of learning Python, especially as your first language, which we will discuss.

    It is a language that is remarkably easy to learn, and it can be used as a stepping stone into other programming languages and frameworks. If you're an absolute beginner and this is your first time working with any type of coding language, that's something you definitely want.
    Python is widely used, including by a number of big companies like Google, Pinterest, Instagram, Disney, Yahoo!, Nokia, IBM, and many others. The Raspberry Pi - which is a mini computer and DIY lover's dream - relies on Python as it's main programming language too. You're probably wondering why either of these things matter, and that's because once you learn Python, you'll never have a shortage of ways to utilize the skill. Not to mention, since a lot of big companies rely on the language, you can make good money as a Python developer.
    Other benefits include:

    1) Python can be used to develop prototypes, and quickly because it is so easy to work with and read.

    2) Most automation, data mining, and big data platforms rely on Python. This is because it is the ideal language to work with for general purpose tasks.

    3) Python allows for a more productive coding environment than massive languages like C# and Java. Experienced coders tend to stay more organized and productive when working with Python, as well.

    4) Python is easy to read, even if you're not a skilled programmer. Anyone can begin working with the language, all it takes is a bit of patience and a lot of practice. Plus, this makes it an ideal candidate for use among multi-programmer and large development teams.

    5) Python powers Django, a complete and open source web application framework. Frameworks - like Ruby on Rails - can be used to simplify the development process.

    6) It has a massive support base thanks to the fact that it is open source and community developed. Millions of like-minded developers work with the language on a daily basis and continue to improve core functionality. The latest version of Python continues to receive enhancements and updates as time progresses. This is a great way to network with other developers.
  • Python Environment Setup

    Python Environment Setup

    One of the most important things you'll do when working with any programming language is setup a development environment which allows you to execute the code you write. Without this, you will never be able to check your work and see if your website or application is free of syntax errors.
    With Python, you also need something called an interpreter that converts your code - which makes up the entirety of your application - to something the computer can read and execute. Without this interpreter, you'll have no way to run your code.
    To convert your code, you must first use a Python shell, which calls upon the interpreter through something called a "bang" line.
    As for creating an application or file, there are two ways to do this. You can create a program using a simple text editor like WordPad, or Notepad++. You can also create a program using a Python shell. There are advantages and disadvantages to each method, which we'll discuss next.

    Python Shell versus Text File

    A shell is a program or tool that can be used to interact with a system. For instance, the Windows operating system shell can be tapped into by using a "terminal" or command line to submit commands and arguments.
    With Python, things work a bit differently than an operating system shell. The Python shell is used to interact with an interpreter, which feeds code to a computer in a form that it can understand.
    When you execute a Python program that you've written, the interpreter reads the code and converts it into usable commands. The important thing to note is that all of this is done after the program has been executed.
    With a shell, the interpreting - or conversion - happens in real-time as you type the code into the computer or system. This means that the actual program is executing as you type. This gives you some idea of how your final code will look, and what your program is actually going to do.
    When you write code in a text file, none of that happens until you feed the document into an interpreter. If you have Python installed on your computer you can call upon the interpreter using a command line, but this step is done after you've already written the code.
    This makes it more difficult to spot errors in your code, and it can also be frustrating if the interpreter runs into issues, because they may not be as apparent as they would if you had used a shell. Still, a lot of developers prefer to use a text editing tool because it is simple and easy to do.
    There are text editors with increased functionality - like Notepad++ - which were specifically developed with programming in mind.

    The Best Place to Start

    Before you can do anything with a programming language, you first need to configure the development environment. Now, we're going to cover how to setup Python and the interpreter that will execute your custom programs.
    Python comes pre-installed on Mac and a majority of Linux distributions. However, you may need to download an updated version depending on how old your system is.
    TIP: You can easily check your Python version by opening the terminal and running the following command:


    If you're running Windows, you'll need to download Python from the Python Software Foundation (link below).

    How Do I Get Python?

    If you need to download Python, the best place to go is the official site. You'll need to download the version specific to your operating system and processor (32 or 64 bit).

    Mac: Most Mac OS X computers already have Python 2.x installed, which is perfectly fine to use. The best way to install the latest version is to use to activate and manage them. You'll find instructions on . You can also download Python directly from the PSF if you prefer.

    Linux: Python is included with most distributions of Linux. Check your current version and be sure to upgrade using the package manager, if necessary.
    Windows: Just download Python from the PSF.
    TIP: If you're using Windows, be sure to select the option that adds Python.exe to your system path during installation. You can do this by selecting the option next to "Add python.exe to path," and then choosing your local hard drive as the install location.

    Which Version Should I Use?

    There are two main versions of Python, which can make things confusing for beginners and novice coders. The two versions are Python 2.x and 3.x. The good news is that when it comes to syntax, they are pretty much identical, and it's acceptable to develop with both versions.
    Version 3.5.x of Python (or greater) is currently in active development. This means that it is constantly receiving new features and functionality, as the open source community continues to develop it. If you want bleeding edge in terms of features and support, then 3.5.x is the way to go.
    Python versions from 2.7.x to 3.4.x (3.2.x included) are still actively maintained by the community. This is important if you need help or encounter problems. Because it's been around so long, 2.7.x also has the most support from third-party libraries. 
    While looking at libraries, if you see they have not been ported to a newer version of Python, you'll want to stick with the older version.
    Most importantly, once you learn one version of Python it's not difficult to make the jump to another version. If you're moving up - as in moving to a newer version - you'll simply need to learn the new features and functions. If you're moving backward you shouldn't encounter any problems although you will have to figure out what functions are incompatible with the older version.
    Long story short, it's entirely up to you which version of Python you use! There's no right or wrong answer, and it's painless to make the jump from one version to another should you realize you need to do so later on.

Post a Comment

0 Comments