程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

[python] introduction

編輯:Python
Let's introduce Python What is it? .

python characteristic

Since the introduction python, We must know first python What are the advantages and disadvantages of other languages .

advantage :

  • 1. Easy to learn : Python There are relatively few keywords , Simple structure , And a clearly defined grammar , It's easier to learn .
  • 2. Easy to read : Python More clearly defined code .
  • 3. Easy to maintain : Python The success is that its source code is fairly easy to maintain .
  • 4. An extensive library of standards : Python One of the biggest advantages of is rich libraries , Cross platform , stay UNIX,Windows and Macintosh Very compatible .
  • 5. Interactive mode :  The support of interactive mode , You can input the execution code from the terminal and get the result language , Interactive test and debug code snippets .
  • 6. portable :  Based on its open source features ,Python It's been transplanted ( That is to make it work ) To many platforms .
  • 7. Scalable :  If you need a piece of critical code that runs fast , Or I want to write some algorithms that don't want to be open , You can use C or C++ Complete that part of the program , And then from your Python Call in program .
  • 8. database : Python Interface to all major business databases .
  • 9.GUI Programming : Python Support GUI Can be created and ported to many system calls .
  • 10. Embeddable :  You can take Python Embedded in C/C++ Program , Let users of your program get " scripting " The ability of .

I believe that if you have learned other languages, especially difficult ones , You will find python It's really simple N The Times .

shortcoming , Insufficient :

  • 1 、 Slow running speed  :
  • C The program is very slow , because Python It's interpreted language , The code is translated line by line into CPU Understandable machine code , This translation process is very time-consuming , So it's slow . and C The program is compiled directly into CPU Executable machine code , So relative Python for C The language executes very fast .
  • 2、 Code cannot be encrypted :
  • To publish the program you wrote , It's actually publishing source code , And interpretive language , You have to publish the source code .
  • 3、  Forced indentation :
  • Python There is a very strict indentation Syntax , As long as the indentation error, the program crashes immediately .
  • 4 、 GIL**** Global interpreter lock
  • At any moment , Only one thread runs in the interpreter . Yes Python  Access to virtual machines is interpreted globally (GIL) To control , It is this lock that ensures that only one thread is running at the same time . encounter i/o When blocked, it will release (GIL) therefore Python Multithreading is not really multithreading , It is CPU Very fast execution , It doesn't make people feel GIL The existence of .(GIL) Will be in Python Advanced stage explanation .

Of course, by contrast ,python The advantages and disadvantages of .

What is?  python

Python Is an object-oriented interpreted computer programming language , from   Guido · Van rosum   Development , The first public release was released in  1991  year . It is often nicknamed glue language , Be able to make various modules in other languages ( In especial C/C++) It's easy to connect .
Here I will focus on the explanation of the red font :( Baidu )
object-oriented :
oriented object english :(Object Oriented) yes Software development methods , A programming paradigm . oriented object The concept and application of the concept has gone beyond Programming and software development , Extend to Database system 、 Interaction Type interface 、 Application structure 、 Application platform 、 Distributed systems 、 Network management structure 、CAD technology 、 Artificial intelligence Other fields . Object oriented is a kind of understanding and understanding of the real world abstract Methods , It is the product of the development of computer programming technology to a certain stage .
interpreted :
python Is an explanatory language , This kind of language : The program doesn't need to compile , The program is translated into machine language , Every time you hold on to   Every line has to be translated once . So it's less efficient , comparison C or C++,python It's really low , But it's nothing for python Come on .
Glue language :
Glue language , It's used to connect Software components Of Programming language , Usually refers to Scripting language .
The specific application fields are :
Input and output commands , Interface , Dynamic link library , Static link library , service , Object etc. .

python The history of development

origin :

  • 1989 Year by year Guido van Rossum  Development as ABC Inheritance of language
  • 1991 First version released in
  • Guido  yes Monty Python Fans of the comedy group named  Python

course :

  • 2011 year 1 month TIOBE The programming language ranking is 2010 Language of the year
  • 2014 After year Python The usage rate of has been increasing linearly
  • 2017 year IEEE Research Report shows Python Is the most popular language
  • 2019 The most popular Python Chinese articles
  • 2020  Programming language of the year

Development :

  • 2000 Released in Python2.0 edition , Increase garbage collection , Support Unicode
  • 2008 Released in Python3.0 This version is not fully compatible with previous Python Source code
  • 2020 The government will no longer support Python2.0 edition

expand :Guido van Rossum( Guido · Van rosum ), Is a Dutch computer The programmer ,Python The father of , stay  Python  Community , Guido · Van romseum is thought to be “ A benevolent dictator (BDFL)”, He is still concerned about  Python  Development process of , And make decisions when necessary . He was in  Google  Work , Where he spent half his time maintaining  Python  Development of .2020 year 11 month 12 Japan ,64 Year old Python The father of Guido van Rossum In their own official announcement : Because retirement is too boring , I decided to join Microsoft  Of  DevDiv Team. It is said that the big man thought ABC Language has some shortcomings , At that time, because it was too boring , So there was python This language , wow , A big man is a big man to a big man   Pay tribute to .

python What can I do



Web The background and development :

There are two modes of application C/S、B/S.C/S The client side. / Server side program , In other words, such programs generally run independently . and B/S It's the browser side / Server side applications , Such applications generally rely on IE Wait for the browser to run .WEB Applications are generally B/S Pattern .Web First of all, the application is “ Applications ”, And using standard programming languages , Such as C、C++ There's no essential difference in the programs that you write . However Web Applications have their own unique features , It's based on Web Of , Instead of running in the traditional way . let me put it another way , It's a typical browser / The product of server architecture .
One Web Applications are made up of a variety of tools that perform specific tasks Web Components (web components) Formed and passed Web Show the service to the outside world . in application ,Web The application consists of multiple Servlet、JSP page 、HTML file as well as image file Other components . All these components coordinate with each other to provide users with a complete set of services .

The crawler development :

Web crawler ( Also known as web spider , The Internet robot , stay FOAF Community Center , More often referred to as a web chaser ), It's a rule of thumb , Automatically capture World Wide Web information Program perhaps Script . Other unusual names are ants 、 Auto index 、 Emulator or worm .

Data analysis :

Data analysis refers to the use of appropriate Statistical analysis Methods a large number of data collected were analyzed , Summarize, understand and digest them , To maximize the functionality of data , Play the role of data . Data analysis is a process of studying and summarizing data in detail in order to extract useful information and form conclusions . [1]

The mathematical basis of data analysis is 20 Established in the early part of the century , But it wasn't until the advent of computers that practical operations became possible , And make the data analysis popularized . Data analysis is a combination of mathematics and computer science .

Operations and development :

Operation and maintenance , Here it means Internet Operation and maintenance , It usually belongs to the technical department , And Research and development 、 test 、 System management It is also the technical support of Internet products 4 Large department , This division will be somewhat different between domestic and foreign companies as well as between large and small companies .
The general process of the generation of an Internet product is : The product manager 、 Demand analysis 、 The R & D department develops 、 The testing department tests 、 Deployment, release and long-term operation and maintenance of the operation and maintenance department .
Operation and maintenance , In essence, it is to the network 、 The server 、 Operation and maintenance at all stages of the service life cycle , At cost 、 stability 、 An acceptable state of agreement on efficiency .

machine learning :

Machine learning is an interdisciplinary subject , Probability theory 、 statistical 、 Approximation theory 、 Convex analysis 、 Algorithm complexity Theory and other disciplines . Specializing in how computers simulate or realize human Learning behavior , To acquire new knowledge or skills , Reorganize the existing knowledge structure to improve its performance .
It is Artificial intelligence The core , It is the fundamental way to make computers intelligent .

Artificial intelligence :

Artificial intelligence (Artificial Intelligence), english Abbreviation for AI. It is Research 、 Development be used for simulation 、 extend And expand people's intelligence The theory of 、 Method 、 A new technical science of technology and application systems .
AI is Computer A branch of Science , It attempts to understand the essence of intelligence , And produce a new one that can Human intelligence Intelligent machines that react in a similar way , Research in this field includes robots 、 Speech recognition 、 Image recognition 、 Natural language processing and expert system etc. . Since the birth of artificial intelligence , Theory and technology are maturing , The field of application is also expanding , You can imagine , Technology products brought by artificial intelligence in the future , It will be human wisdom Of “ Containers ”. Artificial intelligence can be used for human consciousness 、 Simulation of information process of thinking . Artificial intelligence is not human intelligence , But think like a person 、 It can also surpass human intelligence .
Artificial intelligence is a very challenging science , People engaged in this work must know computer knowledge , Psychology and philosophy . Artificial intelligence is a very wide range of science , It's made up of different fields , Like machine learning , Computer vision and so on , On the whole , One of the main goals of artificial intelligence research is to make machines competent for some complex tasks that usually need human intelligence to complete . But different times 、 Different people treat this “ Complex work ” The understanding of is different . [1]

 2017 year 12 month , AI was selected “2017 Top ten Chinese media buzzwords of the year ”.

Set up the environment :

Build development environment

1  You can go to www.python.org Download installation package , And then through configure、make、make install Installation .
2  You can also go to www.activestate.com To download ActivePython The component package .(ActivePython It's right Python Binary packaging of core and common modules , It is ActiveState Issued by the company Python development environment .ActivePython bring Python It's easier to install , And can be applied to a variety of operating systems .ActivePython Some common Python Expand , as well as Windows Programming interface of environment ). Yes ActivePython Come on , If you are windows user , download msi Just install the package ; If you are Unix user , download tar.gz The package can be decompressed directly .
3 Python Of IDE, Include PythonWin、Eclipse+PyDev plug-in unit 、Komodo、EditPlus.

edition

python2 And python3 It's the two major versions at the moment .
In the following two cases , It is recommended to use python2:
1  When you have no complete control over the environment you are about to deploy ;
2  When you need to use certain third-party packages or extensions ;
python3 It's officially recommended and fully supported in the future , At present, many function improvements are only in python3 On the version .


good , This article python This is the introduction of , I'll write later python Chapter one , About python Content and knowledge points , Unknowingly, it is the sixth blog , Although I write a blog every few days , But it's good to stick to it . I hope I can continue to stick to it in the future , come on. ! If this blog allows you to python Have a certain understanding of the introduction of , Don't forget to give the blogger a big compliment .

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved