Import TimePrint(Time.time ())#1970 to present time, in the form of seconds#Time.sleep (1) # delay, CPU not workingPrint(Time.clock ())#Calculate CPU Execution TimePrint(Time.gmtime ())#structured time, UK world standard TimePrint(Time.localtime ())#
1. There are two ways to convert any number into a string.(1) Str () is used to convert a numeric value into a form that is easy to read. Print (str ("I am Chinese")) >>> I am Chinese(2) repr () is the official standard for the string that is used
First starting from 2 the natural number sequence2,3,4,5,6,7,8,9,10,11,12,13,14 ...Excluding multiples of 2 and 2, Odd series3,5,7,9,11,13,15,17,19 ...Reject multiples of 35,7,11,13,17,19Reject multiples of 5, and so on#创建一个奇数序列Def Jishu ():N=1While
In the previous study of the comparison of multi-mode, there are forward search, there are back-to-search, there is a positive pattern, there is a negative mode. This time to learn one, is the post-search affirmation mode, meaning that has been
A python tuple is similar to a list, except that the elements of a tuple cannot be modified.Tuples use parentheses, and the list uses square brackets.Tuple creation is simple, just add elements in parentheses and separate them with commas.Create an
Objective:Log in before the blog is a JSON parameter, some logins are not JSON, such as Jenkins's login, this article with Jenkins Login as a case, the data parameters.First, login Jenkins grab Bag1. Login to Jenkins and enter your account number
Login Interface ExercisesRequirements: Read the account file, login three times the wrong password will lock and write to the lock file# python 3.6 Login Interface Practice # _*_ coding:utf-8 _*_import sysimport osimport getpassi = 0while i This
names=["Alex", "Peter", "Sam"Add: Names.append ("Tom"), inserted at the end of the position;Names.insert (2, "Tonny"), specifying position insertionNames.extend (list) extension listDelete: Names.remove ("Alex")Del Names[2]Names.pop (0) default last
List-derivedExample one: Any number within 30 that can be divisible by 3List derivation 1 for inch if is 0] Print (multiples) # Output: [0, 3, 6, 9, (+), (+) ,-Example two: The square of all numbers within 30 that can be divisible by 3List
Base Library1. Regular Expressions: ReSymbol() parentheses--grouping[] Brackets--The character class, matches any one of the characters #注: Character Set "" in the content as ordinary characters! (except-\^){} curly braces--qualifying number of
The Python crawler is easy for everyone to understand. Well, since we're used to it, of course we have to encapsulate it.So we can first encapsulate a parent crawler.My own design idea is, first of all, the crawler must have a field to store the
Anonymous grouping of URL configuration systems
A well-known grouping of URL configuration systems
Distribution app for the URL configuration system
URL reverse parsing of URL configuration system
Request object of view function
ObjectiveSometimes it is not easy to find an element on the page by the attribute of the element, and you can crawl the information from the source. Selenium the Page_source method can get to the page source code.Selenium of the Page_source method
Go to Blog: Shanghai-leisurelyObjectiveIn the post request, sometimes the body part to pass the data parameter, and sometimes the body part of the JSON parameter, then the question is: When to pass the JSON, when should pass data?I. Identification
1:helpYou need to get information about any function, type in Python, use the Help (' content ') command to view the assistance, and press Q to exit the help.2: Formatting stringsThe format method is an important way to format data.String
1.StringIO ModuleIn peacetime development process, sometimes we may not need to write in the file, we can directly through the Stringio module directly to the system memory, if not, can be directly cleared. Stringio is primarily used to write
Print () Output color tipsDisplay color format: \033[display mode, font color, background color m ... [\033[0m]--------------------------------------------------------------------------------------Font Color| Background Color |Color Description------
There are six types of data in Python3:
Number
String
List
Tuple
Sets
Dictionary
Number (numeric)Python3 supports int, float, bool, comlpex (plural)int denotes long integer, only this type of integerThere is no bool
Simple multi-thread demonstration and simple multi-thread demonstrationI. Preface
We know that a single-core cpu can only execute one task at a time. If we are on a single-core cpu computer, we can log on to qq, listen to music, or write documents
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