Today I looked up some python processing of XML documents, before using Java to process XML files, this should be used later, here first record the most basic use of the operation.
The XML document format to parse is
You can do some processing with
The PIP in Python is an official source, and it is very slow to install the PIP at home, so it is best to replace it with the source address in China.
Domestic PIP Mirror Source
Tsinghua: Https://pypi.tuna.tsinghua.edu.cn/simple
watercress:
This book has been examined in detail in the course of publication, but the size problem remains, thanks to the reader for the mistakes noted in this book. The error on page 34th does not complain on the Python2.7.9 version. 1th Edition Corrigendum
Modules: Categories of modules:Third-party modules/extensions: Those features that were not installed when the Python interpreter was installedCustom module: You write a function if it is a common function, then you think of it as a moduleBuilt-in
Create List sample_list = [' A ', 1, (' A ', ' B ')] Python list Operation sample_list = [' A ', ' B ', 0,1,3] get one of the values in the list Value_start = Sample_list[0]end_ Value = Sample_list[-1] Deletes the first value of a list del
First, what is selenium?A: Automated test tools that support multiple browsers. Used to drive the browser, issuing instructions for the browser to make a variety of actions, such as pull, jump and so on.Crawlers are primarily used to solve
Monkey patch refers to dynamic substitution at run time, usually at startup.Use Gevent will know, will be at the beginning of the place Gevent.monkey.patch_all (), the standard library in the Thread/socket and so on to replace. So we can use it as
? In the process of using airflow, a large number of DAG scripts are required for performance testing, and if you write a DAG script a bit too much trouble, then think of the Python jinja2 template engine to implement batch script generation.Install
= = is a comparison of the values at both endsis to compare memory addresses:The memory address of the data can be obtained with the ID ()In Python, in order to store data in small memory, small data pools are built into the type int and str types,
1. Basic data Type (INT,BOOL,STR)int integerThe STR string. Generally do not store large amounts of dataBOOL Boolean value. Used to judge. True, FalseList of lists. For storing large amounts of data, [] indicates. It can be loaded with various data
Naming conventions for Python variable names:
Variable names are freely combined by letters, numbers, and underscores
Variable names cannot start with a number
Cannot be a keyword in python
Variables to be descriptive
Variables
1. Dictionary Dict
Dict with {} to indicate that the key value is unique to the data {Key:value} key
Keys: All must be hashed, except for lists, immutable data types can be used as keys in the dictionary
There is
69605318Python contains the module method in subdirectories is relatively simple, the key is to be able to find the path to the module file inside the Sys.path.Here are some examples of common situations:(1) The main program and the module program
1. Reflection2. Built-in methods__ Name __: Special method/Built-in method in classDouble Subscript Method Magic method1.__call__Instantiating an object ()---->> equivalent to executing the __call__ methodApplication: Used to view the execution
Single-Case modeThe singleton pattern (Singleton pattern) is a commonly used software design pattern that is primarily intended to ensure that only one instance of a class exists . A singleton can come in handy when you want the entire system to
We usually call functions that can be used as variables, called higher-order functions. Functional programming refers to higher-order function programmingExample 1:The sum of the absolute values of the two numbers.Analytic: Absolute function abs, we
#-*-coding:utf-8-*-#Author:keekuun"""JSON: Transitive objects between different languages JSON Python data type correspondence {} dict[] list "string" str123.6 Int/floattrue/false true/falsenull None"""ImportJSON"""Note the py file name is not
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