From: Laboratory building
Http://python.usyiyi.cn/python_278/tutorial/index.html
http://woodpecker.org.cn/abyteofpython_cn/chinese/
PYTHON-PEP8 Official Code Style guide
Google-python Code Style Guide
The Python source code format check under Linux:
$ sudo apt-get update
$ sudo apt-get install PEP8
PEP8 Check File source code format error:
$ PEP8 file_name.py
Source code: Use UTF8 encoding by default:
#-*-Coding:utf-8-*-
In a BSD-like Unix system, Python can execute directly as a shell, specifying files and schemas in the first line of the script file:
#! /usr/bin/env python
======================================================
String:
"" "or" "" "": using three quotation marks, you can indicate a multiline string. You can use single and double quotation marks freely in three quotes.
Escape character \: Escaped ' & ' & \
In a string, a single backslash at the end of the line indicates that the string continues on the next line instead of starting a new row.
Natural strings: If you want to indicate certain strings that do not require special handling such as escape characters, then you need to specify a natural string. Natural strings are specified by prefixing the string with R or R.
For example r"Newlines are indicated by \n"
.
Be sure to use a natural string to process the regular expression . Otherwise, you will need to use a lot of back slashes.
Unicode string: Use non-English text, plus u or u before the string.
Cascading strings: Put two strings in a literal order, and they will be automatically cascaded by Python.
For example, ‘What\‘s‘ ‘your name?‘
it will be automatically converted "What‘s your name?"
.
Python QuickStart (1)