Python First Knowledge
To the old boy Wu Sir article (python2): http://www.cnblogs.com/wupeiqi/articles/5433925.html
Kung Fu Sir Article List (Python2): http://www.cnblogs.com/wupeiqi/articles/5433893.html
CENTOS6 Upgrade Python2 to python3:http://www.cnblogs.com/lyy-totoro/p/5603102.html
Simple notes are as follows:
Features of Python
Can write Web pages, can also write background functions. Low execution efficiency and high development efficiency (compared to Java)
Types of Python
Jpython:java developed Python, run Python code first into Java code, and then execute
Python language implemented on Ironpython:.net and Mono, as in the same way
Javascriptpython:javascript developed Python, the same way of execution
Rubypython: analogy, ibid.
Cpython:cpython is our common Python, which is the most stable and powerful python developed by C.
PyPy: This is Python developed with CPython. Execute the fastest python, but not fully functional and stable
Python execution process
Install Python to OS, write files according to Python rules, hand over files to Python interpreter, read file contents to memory, execute action, get execution result
Variable
Can only consist of uppercase and lowercase letters, numbers, underscores, but cannot start with a number;
And the following built-in keywords cannot be declared as variables:
[' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ', ' for ' , ' from ', ' global ', ' if ', ' Import ', ' on ', ' is ', ' lambda ', ' no ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' try ', ' while ', ' with ', ' yield ']
A simple example:
#!/usr/bin/env python-specified interpreter#-*-coding:utf-8-*-#编码, py2 must be specified, otherwise garbledTime ="20180422"username= Input ('Enter user name:') Password= Input ('Enter Password:')ifUsername = ="Erbiao" andPassword = ="erbiaopasswd" :Print("Login Successful") Print(time)
Execution effect
(i) Python first knowledge and variables