1. Establishing a database connectionImport MySQLdbConn=mysqldb.connect (host= "localhost", user= "root", passwd= "sa", db= "MyTable")Cursor=conn.cursor () Using a Connection object to get a cursor object2. Perform database
Import Os,errno
#基本工具类
#① recursively generates a folder or file under the path of the input
#② recursively delete the folders and files below the input path
‘‘‘
Param:dirpath
return:
authorcreated by Wu Yongcong 2017-8-17
WedgeAs a python developer that writes functions, we are going to work from the company starting today. Write a function and give it to other developers.Def func1 (): print (' in func1 ')At the end of the quarter, the company's leadership to give
Python's data type can be understood as two sets 1 of their own unique data types, such as list,dict, which is Python's own special2 If you need to use process communication, or embed DLLs written in other languages, you must use the C standard data
Bubbling algorithm1.data = [4,3,2,1]count=0 forIinchRange (0, Len (data)):#Len (data) represents the total length of the list#take the first value of the outer function to loop forJinchRange (i + 1, Len (data)):#Compare the first value of the
View modules under 1.Windows or Linux console1) PIP listThis command looks at the third-party module that is installed in Python.2) Pip freezeThis command belongs to the old version of Python.3) Pydoc ModulesThis command looks at all the modules,
Lists are implemented in the form of classes.The Create list is actually an instantiation of a class.Therefore, the list can be manipulated in several ways.Functions and methods for Python list operations
The list operations
1. InitialSELENIUM[1] is a tool for Web application testing. The selenium test runs directly in the browser, just as the real user is doing. Supported browsers include IE (7, 8, 9, ten, one), Mozilla firefox,safari,google Chrome,opera, etc. The main
FINDALL (tag, attributes, recursive, text, limit, keywords)Find (tag, attributes, recursive, text, keywords)Tag parameter tag: Pass the name of a label or multiple label names Python list to do label parametersthe attribute parameter attributes is
The Python socket library provides functions to convert data between the network byte order and host byte order . What role does it have?When writing low-level network applications, it may be necessary to handle low-level data that is transmitted
def Jia (x, y): Return x+ydef Jian (x, y): Return x-ydef cheng (x, y): return x*ydef chu (x, y): return x/y# A dictionary is built so that the corresponding operator is taken to the corresponding operation method: operator = {"+": Jia, "-":
1. Integer types and operationsPython's data types are: reshape, float, and string1.1 Integer typeAn integer is a number that is not part of a fractional number: such as: 25,-86,0, etc.The operations supported by Python are: + 、-、 *,/,//(divisible),
Follow the old boys ' education of Alex's video to learn python, write a blog to record their learning process, and record the points of knowledge taught.This microblog begins with a ritual "Hello word" learning a program, such as the introduction
Python provides two sorts of sorting methods:1, the list of member functions: L.sort (), in situ rearrange the list, did not create a new list;2, built-in function: Sorted (L), generate a new list, do not change the original list;--------------------
1. Decorative DeviceAdorners are used to implement a section function, that is, some functions must be implemented before the invocation of functions, such as whether the user is logged on, whether the user has permissions such requirements, are
1. Install NumPy extensionAccording to the content of some articles, download the corresponding version of "NUMPY?1.13.1+MKL?CP36?CP36M?WIN_AMD64.WHL" from http://www.lfd.uci.edu/~gohlke/pythonlibs/always Prompt "is Not a supported wheel in this
The enumerate function iterates through the elements in the sequence and their subscripts.
Enumerate function Description:
Function prototypes: Enumerate (sequence, [start=0])
Function: Sequence data and data subscript are listed separately for the
Introduction to the binary method of search
Dichotomy search (binary search), also known as binary retrieval, the basic idea of binary retrieval is that the elements in the dictionary are stored in an array in an orderly way from small to
Python self-study-decorator and python
I have learned some object-oriented knowledge before, And I feel there is a correlation between them. For example, the first element of the decorator is the closeness of the decorated function and cannot be
Python copy and python copy
Test environment: python 2.7
Use module copy. py
There are two methods in this module
Copy. copy () # Light copy
Copy. deepcopy () # Deep copy
What is the difference between shallow copy and deep copy:
The content of
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