First Picture:
We know: 1 bytes = 8 bits
Since Python was born earlier than the Unicode standard, the earliest Python only supports ASCII encoding, and the normal string ' ABC ' is ASCII-encoded inside python. Python provides the Ord () and Chr ()
If you want to prevent certain sensitive data from being seen, being modified, and so on, we generally add permissions to the Django code.
Write in the Code: @permission_required ("Auth.add_permission", login_url= '/login/',
Re module common methods:ImportReret= Re.findall ('a','Eva Egon Yuan')#returns all results that meet the matching criteria, placed in the list,#Re.findall (' Regular expression ', ' Match string ') returns the string that satisfies the expression in
Tag: Indicates the system is not stored and Python opens the simplified English alphabetPython Coding knowledge
Coding Introduction
Kinds
Storage units
1. Introduction to CodingEncoding is the process of converting information
Python Basics-ListCommon Ways to list:List.append (obj)---> No return value-operation on the source list
DescriptionThe append () method is used to add a new object at the end of the list.
Parameters
Obj--An object added to the end
First, the variable typeThe value that the variable is stored in memory. This means that there is a space in memory when creating variables.Based on the data type of the variable, the interpreter allocates the specified memory and determines what
%s string
string="Hello"
#%s The result is hello when printing
print "string=%s"% string # Output:string=hello
#%2s means that the string length is 2, and when the original string is longer than 2 o'clock, it is printed at the
03MapThe first parameter that is passed in map () is f,map the F action to each element of the sequence and returns the result as a new iterator.def f (x):return x * xIf you do not use map, you need to write:L = []For n in [1, 2, 3, 4, 5, 6, 7, 8, 9]
One1. Functions for file manipulationOpen ("File name (path)", mode= "mode", encoding= "character set")2. Mode: R,w,a,r+,w+,a+,rb,wb,ab,r+b,w+b,a+bMain: RWAr+B3. Common operations1. Cursor (SEEK) *Seek (0) adjust the light bar to the beginningSeek (0
One1. Functions for file manipulationOpen ("File name (path)", mode = "pattern", encoding= "character set")Note: File path:(1) Absolute path {Search from the root of the disk, or search from the Internet}(2) Relative path to the folder where the
1. Functions for file manipulation:Open ("File name (path), mode="? ", encoding=" character set ")? Represents the mode of file operation (such as read-only, write-only, append, etc.) the character set is the encoding or decoding method.1f = open ("
Socket function
Annotations:Close and shutdown--end data transfer of the socket: close-----Close the socket ID of this process, but the link is still open, other processes with this socket ID can also use this link to read or write the socket
I. Create and export the menu, the menu is immutable. So use tuplesmenus = ("1, Input", "2, Query", "3, delete", "4, Modify", "5, exit")Store user's information ID: {' name ': ' Name ', ' weight ': weight, ' height ': height}For example: There are
__author__ = ' zhht ' #!/usr/bin/env python#-*-coding:utf-8-*-#返回当前执行到的函数的返回值. and maintains the status of the current execution. It's time to do something else. The next time you execute, the location where the last call was received continues to
I. Overview of data typesint: Numeric value, used for mathematical calculations, counting; for example: 1,2,3,4,...STR: string for storing small amounts of data for easy operation.BOOL: Boolean, with only two states True,false. Machine feedback to
If condition statement(1) If condition judgment: (colon)If 1==1:Print (' Really nothing ')ElsePrint (' It will be later ')Description of the # # # code block: In the same column as the code block, as above, if the print is a block of code.# #
Get maximum ValueEnter a number of integers to print the maximum value. If the input is empty, exit the programUse the while loop and the IF statement to determine its printing criteria:Print 99 multiplication tableUse the FOR Loop statement to
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