Programming language Classification Method 1:
- Compile type: such as c,c++, write code as source file, to edit build executable file to execute
- Interpreted type: Like VBS, Python does not need to compile, use the interpreter to execute, better executable; Java uses a compromise between the two, compiling the generated file is still dependent on the interpreter execution, so it belongs to the explanatory language
Programming language Classification Method 2:
- Dynamic type language: No need to specify variable types such as Python, Ruby, VBS, etc.
- Static type language: Check variable types at compile time, such as C, C + +, Java, C #
Programming language Classification Method 3:
- Strongly typed definition language: Variable types cannot be changed, such as Python, Java
- Weakly typed definition language: can be transformed, such as VBS
Python: Strong typing, dynamic, interpreted scripting language
Advantages:
- Powerful class Library
- No need to consider issues such as memory release
- High portability
Disadvantages:
- Slower running speed
- Code cannot be encrypted
- Threads cannot use multi-CPU, that is, the multi-core advantage cannot be exploited
code file format: xxx.py
Python interpreter:
- CPython: The most widely used interpreter
- IPython
- PyPy: Fast, using JIT to dynamically compile Python
- Jython
- IronPython
Python developed from 2 to 3 the most important changes: 3 Unicode support
Download Install: https://www.python.org/downloads/
Configure the environment variable: please baidu by yourself
Execution mode:
- Enter Python in cmd
- Save the py file, cmd into the path, Python xxx.py
- When Linux executes, declare the interpreter first, for example: #!/usr/bin/env python
Python2 default encoding: AscII
Python3 Default code: UTF-8
You can manually declare a character set: Enter #-*-Coding:utf-8 in the first line-*-
Character encoding table past life
- Start, only ascii:only for English letters and some special characters, 1 characters in 1byte
- Later, with the GB2312: included 7k+ kanji
- Later, with the GBK: more included 2w+ Chinese characters
- Later, with the GB18030: more Chinese characters included
- Later, the unified standard is Unicode, with one character occupying 2 bytes
- Later, with Utf-8, a subset of Unicode, English accounted for 1 bytes, Chinese 3 bytes
Python 0 Basic Learning-basic knowledge 1-python Introduction