In Python, the basic data type has the str int boolean list dict tuple etc where STR has more than 30 related methods but the following 7 are commonly usedJoin# split# find# Strip# upper# lower# ReplaceIn addition to the above 7 common methods,
1, installation Beautifulsoup4>pip Install BEAUTIFULSOUP4Error timeout: Read timed out.2. Workaround: Pip--default-timeout=100 install-u beautifulsoup43. Beautiful Soup is a python library that extracts data from HTML or XML files. It is able to use
Built-in functions: ABS () for absolute use: deal with left and right problems, coordinates,Max () max (12,13,14) ——— min () min () min (9,8,7)---->7POW () 5,3----->5 three round () rounding round (3.6)---->4 round (4.5)--->4 comment (bug): If 4.5,6.
First, Introduction to the tutorial1.1 Basic IntroductionThrough the analysis of the landing process and the use of Python to achieve the simulation landing to an experiment to provide Web site, in the experimental process will learn and practice
The confusion lies in the Python Programming (2nd edition) Dong Tsinghua University Press, page 46thThe original text is:"List-derived">>>freshfruit=['Banana','Loganberry','Passion Fruit']>>>alist=[w.strip () forWinchFreshfruit] is equivalent to the
With the understanding of the signal base of Linux, the signal package in the Python standard library is easy to learn and understand. The signal package is responsible for processing signals inside the Python program, typically including
The difference between blocking and non-blocking is where the difference between synchronous IO and asynchronous IO is.Blocking vs non-blocking: Calling blocking IO will block the corresponding process until the operation is complete, and
1.hashlib Module#hashlib模块: Digest algorithm, which converts any length of data into a fixed-length data string (usually represented by a 16-binary string) through a function# #hashlib模块的应用# # #加密Import HashlibMd5_obj = Hashlib.md5 () # The MD5
1. RCases# There are two types of paths:# 1. Relative path, relative to the folder where your current program is located. (Must be mastered)# .. /Return to previous level directory# relative to the folder where the current program is located#
Use the Open function to create a file object, and then you can use the functions commonly used by file objects (files).Example: F = open ('/path/to/targetfile/test.txt ', mode= ' R ', encoding= ' utf-8 ')Open function Parameter Description:First
A primerBased on a single thread to implement concurrency, that is, only one main thread (obviously available CPU only one) to implement concurrency, first review the nature of Concurrency: Switch + save state CPU is running a task, in two cases
---restore content starts---Know the knowledge point: 1, Guardian process:• What is a daemon process:The daemon is actually a ' subprocess ', which is accompanied by a daemon that dies when the code of the main process finishes running.• Why use
1. A small problem:Deleting a list element during a loop will be different from the expected result, but will not cause an errorLis =[11,22,33,44,55] forIinchRange (len (LIS)):#When you use range () for the first time, the value is saved by default,
Attention:# Dictionary is a mutable type# The data in the dictionary is unordered# The syntax of a dictionary entry is a key: value# Any immutable data type can be a key to an entryKnowledge Point one: CreateKey: Must be unique (if the key is
Today's main learning content:1 File stream operationsr,w,a,rb,wb,ab,r+,w+,a+Operational considerations: W Actions Overwrite previous contentThe r+ operation performs a read operation before the W operation is added at the end regardless of where
Seven major design principles:1. Single RESPONSIBILITY PRINCIPLE: one class is responsible for one responsibility.2, the Richter replacement principle "LISKOV SUBSTITUTION PRINCIPLE": Inherited and derived rules. (Subclass replaceable Parent Class)3,
1. Package:Encapsulation is the restriction of access to members of classes and objects, the manner in which they can be accessed, and how they cannot be accessed.Classification:Privatization Package: Current class/object species can be used,
1. Download and install matplotlib componentsEnvironment: WIN10First into the cmd window,First upgrade the tool below, enter the command python-m PIP Install-u setuptoolsInput python-m pip install-i https://pypi.tuna.tsinghua.edu.cn/simple
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