1. Installing the Pymysql module2, the code is as followsImport pymysql# 1, connect database account, password IP port number Database # 2, build cursor # 3, execute sql# 4, get result # 5, close cursor # 6, connect Close coon = Pymysql.connect
What is async?Meaning: The two sides do not need a common clock, that is, the receiver does not know when the sender is sent, so in the message sent will be prompted to receive information, such as Start bit, and at the end of the stop bitPhenomenon:
UrlEncode and UrlDecode
When the URL contains Chinese or the parameter contains Chinese, the Chinese or special characters (/, &) need to be encoded for conversion.The essence of UrlEncode: Convert the string to GBK encoding, and then replace
XML processing: XML is the implementation of different languages or programs to exchange data between the protocol, like JSON, but JSON is more simple to use, in the dark era of JSON has not been born, we can only choose to use XML Ah, so far many
Original Folder A, B, new Folder C, in the case of pictures as an exampleA:00001.jpg 00002.jpg 00003.jpg 00147.jpgB:00001.jpg 000000002.jpg 00147.jsonThe first case: Find files with the same contents under two folders, save and output to folder
All: https://www.cnblogs.com/pyyu/p/6702896.html
ABS (x)
Absolute
Divmod (A, B)
Separate pick-up and remainder, note: integer, floating-point type can be
int ([x[, Base]])
Converts a character
1. Variable naming and usevariable naming rules : A. Variable names can only contain (alphanumeric underscores), and variables cannot start with a number, for example: variable s_1 (correct), variable 1_s (error)B. Variable names cannot contain
an object that can be called by next() a function and continually returns the next value is called an iterator: Iterator . An object that can directly act on for a loop is called an iterative object: Iterable .forThere are several types of data that
1. Arithmetic operation:2. Comparison operation:3. Assignment Operation:4. Logical Operation:5. Member Arithmetic: 1, intPython2 int has range, and long integer typePython3 all the numbers are int no matter how longOn a 32-bit machine, the number of
1 #-*-coding:utf-8-*-2 """3 Created on Thu 13:53:10 20184 5 @author: Frank6 """7 8 Importxlrd #XLRD is a library for reading data and formatting information from Excel files, whether they is. xls or. xlsx files. 9 Tendata = Xlrd.open_workbook
20. Can strings be iterated? Can I use a for loop for each element?>>> name = "AleX">>> for I in Name:... print (i)21, please code implementation: the use of underscores each element of the list is stitched into a string, Li = [' Alex ', ' Eric ', '
Ext: 52205961The Python language has similar class inheritance to C + +, in which Python customizes the first self, like the this pointer in C + +, to the object itself.Examples of simple Python classes:[Python]View PlainCopy
>>> class
Ax Tamping Foundation1th Lesson Environment Preparation and introductionKnowledge point 1: Environment ready, install Virtual box with Ubuntu systemKnowledge point 2:python and installation configuration for Pyenv and PipKnowledge Point 3:mysql
1. Why use Python
Software quality: Python focuses on readability, consistency, and software quality.
Increase developer Productivity: Python code is sized to only 1/5 ~ 1/3 of the C++/java code.
Program portability: Most Python
This article details how Python uses Redis
1, installation
Pip Install Redis
2, basic use
use: import Redis r = Redis. Redis (host= ' localhost ', port=6379, db=0) r[' test '] = ' Test ' # Or you can r.set (' Test ', ' test ') to set key
Example:
The code is as follows:
D = {"root": {"Folder2": {"item2": None, "Item1": none}, "Folder1": {"Subfolder1": {"item2": None, "Item1": none}, "Subfolder2": {"Item3": None}}}
The beautiful output is:
Observe the features:1. Key to the same
After undergoing transplant jinja2 to Python3 's pain, I put the project on hold for a while because I was afraid to break python3 compatibility. My practice is to use only a Python2 code base, and then use the 2to3 tool to translate it into python3
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