I. iterators1. You can use the Dir () function to check the internal defined functions of a class2. Features:__ITER__ () Get iterator__next__ () Gets the front of the element We were straight in? Iterative operation So what exactly is an iterative
One, operator1. Arithmetic operation:2. Comparison operation:3. Assignment Operation:4. Logical Operation:5. Member Arithmetic:
II. Basic data types1. Digitalint (integral type)On a 32-bit machine, the number of integers is 32 bits and the
because the MD5 module was removed in the Python3MD5 operation with Hashlib module in Python3Import Hashlibm=hashlib.md5 () #创建MD5对象passwd= ' aaa123 ' #待加密密码m.update (Passwd.encode ()) #不能直接对字符串加密, first convert the string to bytes typeprint
1, the object is an instance, what is an instanceThe process of running a class is the process of instantiation, and the result of instantiation is that it produces an instanceThe thing about class is that without a manual return, he will load the
Common variables, usually lowercase, separated by ' _ ' between words
The name of the class is named by the hump and capitalized in the first letter
Instance variables start more than normal variables
A proprietary variable that begins with
#!/bin/env python#encoding=utf-8import osimport sysallfile_name = sys.argv[1]def delect(allfile_name): for i in os.listdir(allfile_name): wav_name = allfile_name + ‘/‘ + i + ‘/‘ + ‘train‘# print wav_name for j in os.listdir(wav_name): line =
Yesterday just bought Cui big "Python3 Network Crawler development actual combat", today on to, happy to read the Crawler Foundation this chapter, now record their shallow understanding, if there is no insight into place, hope points
1. Download Python:https://www.python.org/downloads/Note: Select the desired version (Python2 or Python3, 32-bit or 64-bit)2. Install Python:Double-click to open the installation file and install it directly next.3. Configure Environment variables:
1. Install Python:Usually Ubuntu will bring your own, if you need other custom version, please download the installation yourself.2. Download OpenCV source code OPENCV online Linux version of the source package can be downloaded, but it is best to
Eighth Quarter
Read and write files
Mode
Describe
R
Open the file as read-only. The pointer to the file will be placed at the beginning of the file. This is the default mode.
Rb
The first day after reading the Python teaching video, immediately wrote a short code, the middle encountered some problems, want to immediately record down, share with you.Writing the Login interface
Enter User name password
Show
To force type conversions:Int ()Float ()STR ()List ()Tuple ()Set ()Dict ()In summary, these types of conversion functions are basically consistent usage, essentially int (to convert data). The return value type is the corresponding data type Max ():
Then send the request out, define the variable response, with the Read () method to observe, note the symbol decoded into the form of Utf-8, the province of garbled:Print a look at the results:See such a big bar on it, compare the source of the Web
#对lt列表里元素从小到大排序 #一, select Sort by LT = [3, 5, 2, 1, 8, 4] #求出lt的长度 n = Len (LT) #外层循环确定比较的轮数, X is subscript, lt[x] represents all elements of LT in the outer loop for x in Range (n-1): #内层循环开始比较 for y in Range (x+1,n): #lt [
A = 12345#创建一个空字符串ret = ""#whlie循环, the condition is when a is true, that is, A is not 0While a: #定义一个变量, the remainder of a Last = a%10 #关键一步, turn the number into a word assigned value to RET RET = ret + chr (ORD ("0") +last) # A for
Virtualenv is a tool for creating an isolated python environment. VIRTUALENV Create a folder that contains all the necessary executables to use the packages required by the Python project.InstallationPip Install VirtualenvBasic use
Create a
1, Java Environment, configure the appropriate environment variables.See if the configuration is successful as follows:2, Python environment, configure the corresponding environment variables. Includes two paths of Python and python/scriptsSee if
In Python, the type of a string can be categorized as Class three: Str,bytes,bytearray, where str and bytes are immutable types, and ByteArray are mutable types. Because of the difference between Python 2.X and Python 3.X, they have different
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