From PIL import Imageim = Image.open ("Picture path")Im.function ()Common functions:1, Im.crop (x,y,x1,y1)Cut the picture, (the horizontal axis of the starting point, the ordinate of the starting point, width, height)2, Im.resize (128,128)Change the
First, decorator foreplay-closuresIn a nutshell, the closure of a function in Python is a reference to an external scope (but not a global scope) in an intrinsic function, so it is not well understood that the following example helps to
1. Only those parameters at the end of the formal parameter list can have default argument valuesFor example, Def func (A, b=1) is valid, but def func (A=1, b) is not valid.2. The value of the default parameter is an immutable object, such as none,
>>>classTest ():def __init__(self):Pass def __repr__(self):return '1SDF'>>> T =Test ()>>> T#print out the reconstructed value without print directly, oriented to the program, passing in the program1SDF>>>classTest (Exception):def
#有一个文件, the file name is Output_1981.10.21.txt. # use Python below: Read the datetime information in the file name and find out what day is the week. # renamed the file to output_yyyy-mm-dd-w.txt# (YYYY: Four-bit year, MM: two-bit month, DD: Two-bit
The road to wudao-the five-day post of the refining stage
Serialization: changes an object from memory to a stored and transmitted process, and vice versa.
The standard format of objects transmitted between different programming languages is json
Use of the django master page, django
The master page is used to process the same part of the html page to avoid repeated
1. Add a master page
Add the templates folder in the same directory as the manage. py file to save the html file on the master
Python3 Study Notes 3 --- reference http://python3-cookbook.readthedocs.io/zh_CN/latest,Data structures and algorithms (3)
1.11 name slice
Assume that you have a piece of code that extracts specific data fields (such as files or similar formats)
A deep understanding of Python's use and principles of supper, pythonsupper
I. Preface
Python has the concept of inheritance in object-oriented language. It feels awesome at the beginning, and there is also a super class in it. It is often seen that
The road to wudao-the middle of the six-day refining stage, and the road to six-day Refining
Some built-in functions:
Convert the decimal bin () to binary, oct () to octal, hex () to hexadecimal,
Divmod (a, B) returns the tuples of the quotient and
Python3 notes-list, python3 Notes List
List deduplication methods:
1 # create a list and put data 2 a = [, 2] 3 B = [,] 4 5 d = [] 6 for I in: 7 if I not in d: 8 d. append (I) 9 print (d) 10 11 # set deduplication 12 B = set (B) 13 print (B)
List
Python learning history (1) ------ install python, ------ python
According to the course of "Liao Xuefeng", we plan to take 1-2 hours every day for charge.
Python is the famous "Uncle turtle" Guido van rosum during the Christmas of 1989, a
Python exception handling,
Exception Handling Format:
Try:Execute Statement 1Raise custom exception type ()
T custom exception type:
Execute Statement 2
Handle T (exception Type 1, exception type 2 ,......) :# Separate multiple exception types with
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