Python is an interpreted, object-oriented, dynamic data type high-level programming language. Python was invented by Guido van Rossum at the end of 1989, and the first public release was released in 1991. "Python Basics Tutorial" is suitable for developers who want to learn the Python programming language from scratch.
Python is a cross-platform computer programming language. It is an object-oriented dynamic type language that was originally designed for writing automated scripts (shells). With the continuous updates of the version and the addition of new language features, it is increasingly used for the development of independent and large-scale projects.
The founder of Python is the Dutchman Guido van Rossum. During the Christmas period of 1989, in Amsterdam, Guido decided to develop a new script interpreter as an inheritance of the ABC language in order to kill the boredom of Christmas. The reason why Python (meaning boa constrictor) was chosen as the name of the programming language was taken from the British TV comedy "Monty Python's Flying Circus" that premiered in the 1970s.
Tips: This tutorial is mainly for learning Python 2.x version. If you are using Python 3.x version, please move to Python 3.X version of the tutorial. And before proceeding with this tutorial, you should know some basic computer programming terminology. If you have studied PHP, ASP and other programming languages, it will help you understand Python programming faster.
Let’s experience the first Python introductory programming code!
The first Python entry programming code
Example
#!/usr/bin/python print "Hello, World!"
Running example»
Click the "Run Instance" button to view the online instance
Python adheres to a clear and consistent style in design, which makes Python an easy-to-read, easy-to-maintain, and widely-used language that is popular with a large number of users.
Tips: Our Python tutorial will help you learn the Python programming language and its applications step by step. If you have any questions, please go to the PHP Chinese website Python CommunityAsk your questions and enthusiastic netizens will answer them for you.
Advantages and Disadvantages of Python
Advantages
- ##Simplicity: Python is a language that represents simplicity. Reading a good Python program feels like reading English. It allows you to focus on solving problems rather than figuring out the language itself.
- Easy to learn: Python is extremely easy to get started because Python has extremely simple documentation.
- Fast speed: The bottom layer of Python is written in C language, and many standard libraries and third-party libraries are also written in C, which runs very fast.
- Free and open source: Python is one of FLOSS (Free/Open Source Software). Users are free to distribute copies of this software, read its source code, make changes to it, and use parts of it in new free software. FLOSS is based on the concept of a group sharing knowledge.
- High-level language: When writing programs in Python, you don’t need to worry about low-level details such as how to manage the memory used by your program.
- Portability: Due to its open source nature, Python has been ported on many platforms (with modifications to enable it to work on different platforms). These platforms include Linux, Windows, FreeBSD, Macintosh, Solaris, OS/2, Amiga, AROS, AS/400, BeOS, OS/390, z/OS, Palm OS, QNX, VMS, Psion, Acom RISC OS, VxWorks, PlayStation, Sharp Zaurus, Windows CE, PocketPC, Symbian and Google's android platform based on Linux.
- Interpretability: A program written in a compiled language such as C or C can be converted from a source file (i.e. C or C language) into a language used by your computer (binary code , that is, 0 and 1). This process is done through the compiler and different flags and options.
- When you run a program, the linker/reprinter software copies your program from the hard disk to memory and runs it. Programs written in Python do not need to be compiled into binary code. You can run programs directly from source code.
- Inside the computer, the Python interpreter converts the source code into an intermediate form called bytecode, which is then translated into the machine language used by the computer and run. This makes using Python much simpler. It also makes Python programs more portable.
- Object-oriented: Python supports both procedural and object-oriented programming. In "procedural-oriented" languages, programs are built from procedures or simply functions that are reusable code. In "object-oriented" languages, programs are built from objects that combine data and functionality.
Scalability: If you need a critical piece of code to run faster or you want some algorithms to be kept private, you can write part of the program in C or C and then use them in a Python program.
Embeddability: Python can be embedded into C/C programs to provide scripting functions to program users.
Rich library: The Python standard library is indeed huge. It can help with a variety of tasks, including regular expressions, document generation, unit testing, threads, databases, web browsers, CGI, FTP, email, XML, XML-RPC, HTML, WAV files, cryptography, GUI ( Graphical user interface), Tk and other system-related operations. This is called Python's "full-featured" philosophy. In addition to the standard library, there are many other high-quality libraries, such as wxPython, Twisted, and the Python imaging library, among others.
Standard code: Python uses forced indentation to make the code more readable. Programs written in Python do not need to be compiled into binary code.
Disadvantages
Single-line statement and command line output problems: many times the program cannot be written in one line, such as import sys; for i in sys .path:print i. Perl and awk do not have this restriction. They can easily complete simple programs under the shell. They do not need to write the program into a .py file like Python.
Unique syntax
This may not be called a limitation, but the way it uses indentation to distinguish statement relationships still gives many beginners Scholars bring confusion. Even experienced Python programmers can fall into traps.
Slow running speed: This refers to compared with C and C.
Python application fields
Web and Internet development
Scientific computing and statistics
Artificial Intelligence
Education
Desktop Interface Development
Software development
Backend development
What this Python tutorial manual covers
This Python tutorial manual covers everything Basic and advanced knowledge of Python, including Python's syntax, types and variables, functions, generators, modules, object-oriented knowledge, etc.
Tips: Each chapter of this tutorial contains many Python examples. You can directly click the "Run Example" button to view the results online. These examples will help you better understand and use the Python programming language.
Latest chapter
- Python 100例 2016-10-18
- Python JSON 2016-10-18
- Python IDE 2016-10-18
- Python2.x与3.x版本区别 2016-10-18
- python GUI编程(Tkinter) 2016-10-18
- Python XML解析 2016-10-18
- Python 多线程 2016-10-18
- Python SMTP发送邮件 2016-10-18
Related courses
- The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course) 2022-02-17
- Let's briefly talk about starting a business in PHP 2023-01-04
- Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things 2018-01-25
- Login verification and classic message board 2018-03-02
- Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum] 2022-06-28
- Quick Start Node.JS Full Version 2022-09-30
- Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance) 2022-12-08
- Horse soldier spring video tutorial 2022-04-12