Let's take a look at the basic notation for using scrapy to simulate logins:Note: We often debug the code when the basic use of Chrome browser, but I just because of the use of Google Browser (it is always logged on without prompting me to use a
Python string FormattingThere are two ways to format a Python string: the percent-percent, format-mode1, percent of the wayFormat:%[(name)][flags][width]. [Precision]typecode
(name) optional, used to select the specified key
Flags are optional,
1, the basic concept of iteratorsWe already know that for there are several types of data that can be directly acting on a loop:
A class is a collection of data types, such as,,, list tuple , and dict set str so on;
One is generator to
1. The Django time zone is configured in setings.py with the following default configuration:' en -US ' 'UTC'# time_zone = ' Asia/shanghai ' # can be set to Shanghai time use_i18n = == True# use_tz = False # indicates that the
Many programs require users to enter some kind of information, such as allowing users to store game preferences or provide visual data, no matter what focus, the program to store data, then how to store it? The JSON (JavaScript Object Notation)
Company test machine Environment do not know what to unload my package, resulting in Yum run error status:System version: Red Hat Enterprise Linux Server Release 6.2 (Santiago)Kernel version: 2.6.32-220.el6.x86_64Error situation:There was a problem
We've learned that Python supports Boolean types of data, with only a Boolean type True and False two values, but the Boolean type has the following operations:and operation: Only two Boolean values are true when the result is true.True and True #
1. The core of each if statement is an expression with a value of true or false, which is called a conditional test2. An equal sign is a statement, two equals is a question, check if the case is not considered equalCar = ' BMW 'Car = = ' Audi 'FALSE3
Python's hashlib provides a common digest algorithm, such as MD5, SHA1, etc.What is a digest algorithm? Abstract the algorithm is also called hash algorithm and hashing algorithm.It transforms any length of data into a fixed-length data string
Position parametersdef power(x): return x*x; Default parametersWhen a function is defined, it is given the default value of the parameter, and it is not necessary to pass the duplicate parameter value multiple times when calling the
Adorner:Definition: The essence is a function, function: (Decorate other functions) is to add additional functions for other functions;Principle: 1, cannot modify the source code of the adornment function2. Cannot modify the calling mode of the
I pure wild Test ape One, did a year web function test, test a year set-top box, or want to do back to the old bank, self-study for a period of time selenium, learning process, encountered the need to enter the Web page verification code problems,
A conditional judgment if : elif :elif : else: ifThe judging conditions can also be abbreviated, such as writing:if x: print(‘True‘)As long as a non- x 0 value, a non-empty string, a non-empty list, etc., it is judged True ,
1. String merging and linkingPlus sign MergeJoin method Merge2, multiply and sliceLine= ' * ' *30Print (line)>>******************************Slice:Consequence[start_index:end_index:step]Represents the first element, the positive index position
Exercise 3: Numerical and mathematical calculationsThere are a lot of mathematical arithmetic symbols in this chapter. Let's see what they are called. You have to read out their names while you write, until you are bored. The names are as follows:+
Python string concatenation of 6 ways:1. PlusFirst, people with programming experience know that many languages use a plus sign to connect two strings, and Python also uses "+" directly to connect two strings;
1
Before you learn python, you need to have a lot of preparation knowledge, organized roughly as follows:
Installation and connection of virtual machines, Visualbox,putty
Linux operations, due to limited energy can focus on CentOS 6, mainly
Serialization module# Serialization method# format Conversion# Convert data in Python to str---serialization# Data---Deserialization that can be converted to Python by strJSON module# JSON All languages are universal, and the data it can serialize
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