Python one day – about Python

Source: Internet
Author: User

Python is the scripting language that Van Rom accidentally developed as an inheritance of the ABC language.

Python can be used in many fields, including component integration, data analysis, network services, image processing, numerical computing and scientific computing.

Current Python's main application areas:

1. Cloud computing, Cloud Computing's hottest language, typical application OpenStack

2.web Development: Many excellent web frameworks, many large-scale website of the military Commission python development. YouTube Dropbox watercress, typical web framework with Django

3. System operation and maintenance: the necessary language for operation and maintenance personnel

4. Finance: Quantitative trading, financial analysis, in the field of financial engineering, Python is not only used, but also used the most. As a dynamic language, the language structure is clear and simple, the library is rich, mature and stable. Production efficiency is much higher than c,c++,java, especially good at strategy backtesting

5. Graphics Gui:pyqt,wxpython,tkinter

Categories of programming languages:

Based on the compilation method can be divided into:

Compiler type (c,c++,go,swift,oc,pascal)

The compiler compiles each piece of code into a machine language and saves it as a binary file so that the runtime can run the program directly in machine language.

Explanatory type (Js,python,ruby,php,perl,erlang)

The explanatory type is the execution of the program, according to the code of all the explanations into machine language to the computer execution.

There is also a hybrid type of:

java,c#

Based on the language features are divided into:

Static language

The data type is checked during compilation, which means that the data type of all variables is declared when the program is written.

Dynamic language

The language of the data type is not checked during run time, that is, when programming a dynamic type programming language, you never have to make a data type for any variable, and the language will record the data type internally when you assign it to a variable for the first time.

Python and Ruby are a typical dynamic type language, and many other scripting languages, such as VBS, are also dynamic languages.

Type-based can be divided into:
Weak type

Data types can be ignored.

Strongly typed

Enforces a data type definition, that is, once a type is defined. It cannot be changed.

Pyhon's Interpreter:

CPython 2.7 The default comes with the official interpreter, which was developed in C language.

IPython, an interactive interpreter based on CPython, is an interactive and enhanced version of CPython.

PyPy third-party interpreter, the advantage is the execution speed. PyPy uses JIT technology to dynamically compile the py code near the line, so it improves the execution efficiency significantly.

Jython is a Python interpreter running on the Java platform that compiles the PY code directly to Java bytecode execution.

IronPython and Jython are just like the PY interpreter running on the Microsoft. NET Platform.

Installation of Python:

Windows: Skipped, everyone knows.

Linux:

Note that the installation of Fedora is probably the first thing to install the JDK

1. Download the JDK
Downloaded from the official website jdk-8u121-linux-x64 , the download path is http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2. Installing a third-party source

If you do not want to use the tar.gz package, you can install the Fedora 23 version.
# DNF Config-manager--add-repo=http://repo.fdzh.org/fzug/fzug.repo

Or

# DNF Install http://repo.fdzh.org/FZUG/free/23/x86_64/fzug-release-23-0.1.noarch.rpm

Or

# wget Http://repo.fdzh.org/FZUG/FZUG.repo-P/etc/yum.repos.d/

You can see the version of the relevant pycharm in the source installation process above, and then

Apt-get Install pycharm-community.x86_64 #版本号根据也许时间顺序不一致, according to the actual situation to see.

Installation of Python:

Official: Www.python.com/ftp/python itself is downloaded according to version, then Terminal TAR-XVZF Package [-C install path]

Python 3 supports Chinese.

Python is a strongly-typed language with dynamic interpretation. This means that you cannot change the type when it is determined. However, because it is dynamic, the type is determined at execution time.

Variable definition: Python's variable definition is similar to other languages, and is also case sensitive, beginning with the underscore and casing symbols.

Variable_name = value;

VARIABLE is not VARIABLE

The Python interpreter default encoding is ASCII and needs to tell the interpreter what encoding to interpret, #-*-Coding:utf-8-*-

Function: print () format the output function.

Input () output and accept the parameter return. The return type is typically STR, if you want to make a type: Age = Int (input ("What is"? "))  #

If you accept a password, you need to not be visible. You can call the Getpass method of the Getpass module.

Import Getpass

PWD = Getpass.getpass ("Please enter password")

Python's While loop:

1.while true: #无限循环, you can jump out of the loop body by break

Xxx

...

2. While 1<10: #有条件表达式

Xxx

...

Python for Loop:

For I in range: # I end +1 per loop.
Xxx

...

Python's If,if/else,if/elif/else

1 If i < 3:

2 If I < 3:

Elif i>3:

Else

3if I < 3:

Else

First day simple contact with two library sys, OS

SYS.ARGV is an array of arguments received by the calling script.

Os.system ("Df-h") is a call to the system command

Note 1: Strings and variables can be connected by symbol +.

Note 2:python does not have an end semicolon, and it resembles a looping structure forcing the jump bar.

Python one day – about Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.