X Tutup

    

Python Introduction

What is Python?

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.
Often, programmers fall in love with Python because of the increased productivity it provides. Since there is no compilation step, the edit-test-debug cycle is incredibly fast. Debugging Python programs is easy: a bug or bad input will never cause a segmentation fault. Instead, when the interpreter discovers an error, it raises an exception. When the program doesn't catch the exception, the interpreter prints a stack trace. A source level debugger allows inspection of local and global variables, evaluation of arbitrary expressions, setting breakpoints, stepping through the code a line at a time, and so on. The debugger is written in Python itself, testifying to Python's introspective power. On the other hand, often the quickest way to debug a program is to add a few print statements to the source: the fast edit-test-debug cycle makes this simple approach very effective.
Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.

Who manages Python Today?

From version 2.1 onwards, Python is managed by Python Software Foundation situated in Delaware, USA It is a non-profit organization devoted to the growth and enhancement of Python language. Their website is http://www.python.org .

What can Python do?

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.
There are numerous examples of popular, high-load websites/webapps that have been developed using Python. Here are some of the most popular of them:

Features of Python

  1. Simple
  2. Python is easy to use, powerful, and versatile, making it a great choice for beginners and experts alike. Python's readability makes it a great first programming language — it allows you to think like a programmer and not waste time with confusing syntax.
  3. Dynamically typed
  4. Python don't have any problem even if we don't declare the type of variable. It states the kind of variable in the runtime of the program. Python also take cares of the memory management which is crucial in programming. So, Python is a dynamically typed language.
  5. Robust
  6. Python has very strict rules which every program must compulsorily follow and if these rules are violated then Python terminates the code by generating “Exception”
  7. Supports multiple programming paradigms
  8. It supports multiple programming paradigms, including structured (particularly, procedural), object-oriented, and functional programming. Python is often described as a "batteries included" language due to its comprehensive standard library. Python supports both procedure-oriented and object-oriented programming which is one of the key python features.
  9. Compiled as well as interpreted
  10. In various books of python programming, it is mentioned that pythonlanguage is interpreted. But that is half correct the python program is first compiled and then interpreted. The compilation part is hidden from the programmer thus, many programmers believe that it is an interpreted language. The compilation part is done first when we execute our code and this will generate byte code and internally this byte code gets converted by the python virtual machine(p.v.m) according to the underlying platform(machine+operating system).
  11. Cross Platform
  12. Python is a cross-platform language: a Python program written on a Macintosh computer will run on a Linux system and vice versa. Python programs can run on Windows computer, as long as the Windows machine has the Python interpreter installed (most other operating systems come with Python pre-installed).
  13. Extensible
  14. Python allows us to call C/C++/Java code from a Python code and thus we say it is an extensible language. We generally use this feature when we need a critical piece of code to run very fast . So we can code that part of our program in C or C++ and then use it from our Python program
  15. Huge library
  16. The Python Standard Library is huge indeed. It can help you do various things like Database Programming , E-mailing ,GUI Programming etc

Python Download and Installation

This document shows downloading and installing Python 3.8.3 on Windows 10 in Summer 2020. You should download and install the latest version of Python. The current latest (as of Summer 2020) is Python 3.8.3
Python: Version 3.8.3
The Python download requires about 25 Mb of disk space. When installed, Python requires about an additional 90 Mb of disk space.

Downloading

  1. We can download Python from Python website
  2. The website should automatically detect that we are using Windows, Linux/UNIX, Mac OS X or Other. Then Click on Download Python 3.8.3
  3. The file named python-3.8.3.exe should start downloading into your standard download folder. This file is about 25 Mb so it might take a while to download fully if you are on a slow internet connection

Installing

  1. Open the downloads folder and run the file python-3.8.3.exe by right clicking it and selecting run as administrator.
  2. A Python 3.8.3 Setup pop-up window will appear.
  3. Ensure that Add Python 3.8.3 to PATH checkboxes at the bottom are checked.
  4. If the Python Installer finds an earlier version of Python installed on your computer, the Install Now message may instead appear as Upgrade Now (and the checkboxes will not appear).
  5. A new Python 3.8.3 Setup pop-up window will appear with a setup progress message and a progress bar.
  6. Once the installation is over you will get a SETUP WAS SUCCESSFUL message.
  7. Click the Close button.
  8. Python should now be installed.

Verifying

  1. Open Command Prompt
  2. Type the command python –version
  3. In the output we should see the python version number as Python 3.8.3

IDE

An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. PyCharm is one of the most widely used IDEs for Python programming language. PyCharm is a cross-platform IDE that provides consistent experience on the Windows, macOS, and Linux operating systems. PyCharm is available in three editions: Professional, Community, and Edu. The Community and Edu editions are open-source projects and they are free, but they have less features. PyCharm Edu provides courses and helps you learn programming with Python. The Professional edition is commercial, and provides an outstanding set of tools and features.

Installing Pycharm

  1. To download Pycharm visit Jetbrains website
  2. Here you will observe two versions of package for Windows/Mac/Linux
  3. Click the " DOWNLOAD " link under the Community Section.
  4. Once the download is complete, run the exe for install PyCharm. The setup wizard should have started. Click “Next”.
  5. Then mention your destination folder. Click “Next”.
  6. On the next screen, you can create a desktop shortcut if you want and click on “Next”
  7. Click on “Install”
  8. Once installation finished, you should receive a message screen that PyCharm is installed.

    


More Topics Uploading soon...

Do you want to contribute by preparing content for us :
X Tutup