0 Why write this articleOn the one hand, the classical sorting algorithm 冒泡排序 is reviewed, on the other hand, through practical application to test the knowledge of Python basic knowledge, including range function, Len function, for loop, if
PS: Strings are the most data structure involved in programming, and the manipulation of strings is almost ubiquitous. Regular Expressions are the best way to handle strings.
Reference textLiaoche Regular ExpressionsDefinedA regular expression
ObjectiveWhen there are multiple login accounts, we generally use Excel to store test data, this lesson introduced, Python read the Excel method, and save as a dictionary format.First, the Environment preparation1. First install the XLRD module,
Installation1.tomorrow installation, can be installed directly with PIP
Pip Install tomorrow
Single Thread1. The following cases are single-threaded when running, and it is time consuming to download images.#Coding:utf-8
ObjectiveThe previous few are talking about how to locate an element, sometimes a page has multiple objects to operate, if one by one to locate, more cumbersome, this time you can locate a group of objects.Webdriver provides a way to locate a set of
Suppose such a a.py fileDef fun1 ():........Def fun2 ():.........If __name__== ' __main__ ':... #执行的一些语句When you execute this a.py file, __name__ = =‘__main__‘为真,后面的语句可以执行When you import a file in another file and use it as a module, __name__ = =‘
1, center Str.center (Width[,fillchar]) "Function: to center the string according to the width, the default padding space, you can customize the fill character" "English:center=> Center, width=" width, fill= "Fill, char=" character " "Description:
ObjectiveThere are a lot of small partners in the 163 as a login case, found that no matter how positioning can not locate, what is the ghost, this article details the IFRAME related switchTake http://mail.163.com/login page for the case, detailed
Combination1, in addition to the class and class inheritance in Python, there are also a combination of relationships.What is a combination--that is, a class is resolved as a property of another class.is to solve the problem of a class "yes". Eg:
1.while enables iterative through except2.2range differences in Py3 and Py23. A function with yield is a generator function4. Conditions for generator function execution next5. Using the generator to listen for file operations6. Generator trigger
About PythonAlthough Python is running slowly and the CPU is running fast, the network and hard disks are not so fast, so a lot of applications don't need to run so fast. Like in the Traffic Jam Road, the car speed is faster than the taxi, but
Python OS modules are primarily operating files and directories, and are commonly used in the following ways:#1. OS.GETCWD () Gets the directory where the current file is located#2, Os.makedirs (' dirname1/dirname2 ') create a directory, can
Collection of 1.listWhen you cycle through a list data, you will encounter a drop-loss problem, details of the Python list loop traversal, the correct way to delete the dataHowever, the inside said to reverse the list collection, you can use A[::-1
1. ExceptionsExceptions are handled using the TRY-EXCEPT code block. The try-except code block lets python perform the specified action and tells Python what to do if an exception occurs.When you use the TRY-EXCEPT code block, the program continues
some of the content comes from the official website of Liaoche https://www.liaoxuefeng.com/I.. bytes data typeThe data that is transferred on the network or on the disk, in bytes.Details Visible https://www.cnblogs.com/R-bear/p/7744454.htmlIi. list (
1. What do I do if I use the Pycharm tool to not automatically associate objects?First look at the toolbar in the File-->power save mode, check whether the tick, if checked, remove the tickIf the above method is still correct, see if the Import
#!/usr/local/bin/python3#-*-coding:utf-8-*-#key-value#dict unordered, no subscript, no subscript required, because there is keystu={' stu001 ': "Zhang Yu", ' stu002 ' : "Ma Hong Yan", ' stu003 ': "Zhang Guo Bin", ' stu004 ': "Sha Chun Hua"} "--------
Now everyone should learn to program, after all, programs can play a big role in our future life.Some things are repetitive, every day do may feel no meaning, after all, we are lazy people. But there are things that you have to do, like now you're
The content of this article is about the Python built-in module, now share to everyone, the need for friends can refer to the content of this article
Time Module
Timestamp time.time () #打印出的是秒数, counting from 1970 onwards
Time.localtime ()
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