Depth copy
1.Import Copy#浅拷贝Copy.copy ()#深拷贝Copy.deepcopy ()#赋值=2.For numbers and strings , assignments, shallow copies, and deep copies are meaningless because they always point to the same memory address .for dictionaries, tuples, lists , in
Module what is a module: Files that include Python code are called Modules 1. The role of the module: sharing, easy to use 2. Creation, installation and release of modulesa. Put the module file in a directoryB.Add the setup.py file to this
Set is an unordered and non-repeating collection of elementsS1 = set (["Tom", "Jak", "Cat", "Tom"])Print (S1)#结果:{' Tom ', ' Jak ', ' Cat '}. Add ()---Add a new elementExample:. Clear ()---empty all elementsExample:. Difference ()---a difference set
The value in rang (10) refers to the reverse output of the digital:For value in rang (10) [::-1] The digital reverse output is involved:First, reverse Second, detailedThis is a special use of Python's slice notation.A = [0,1,2,3,4,5,6,7,8,9]b = a[i:
1. An expression containing and onlyIn [1'345'out['345' in [10'long'out[ - 0From left to right, false is returned (note: not return false), otherwise the last value is returned.2. An expression containing or onlyor or or falseout[]: 1 in[or or
The main topic of this lesson
Python first Hello World program combat
Python requires user input in combat
Python Import Module
Python formatting
Conditional judgment expression real-combat
Expression for loop combat
Job
Assign values to a variable: for example, A=1. When assigning a value to a variable, the variable is created to store the value in memory, which means that the variable is created in the memory space (corresponding to one address: one value)Python
With...as is called the context Manager, which can perform certain operations when it enters the scope of an object and leaves. This operation is available on its ownSet.Write an example to learn:classTest ():def __init__(self): Self.text="Hello"
Worry about the net will be yellow, write a reptile, my album photos are downloaded. The code is as follows:#-*-coding:utf-8-*-ImportRequestsImportJSONImportOSdefmkdir (PATH): Path=Path.strip () path=path.rstrip ("\\") isexists=os.path.exists
#已知某人死亡年龄, according to the current age of input projections can still live more than a teenager.Death_age=80Name=input ("Person's name:")Age=input ("Person's current Age:")Print (name+ "Can Live" +str (80-int) + "Year!
Driver = Webdriver. Chrome (Chromedriver)1. Return cookies:driver.get_cookies () in the current session2, according to the cookie name search: Driver.get_cookie (cookiename)3, intercept the current page :get_screenshot_as_file (filename), such as:
This article mainly introduces: some common use methods of string1 #!/usr/bin/env python2 #-*-coding:utf-8-*-3 #Author by LH4 5s ='Hello Lh'6S2 ='12h'7 8 Print(s.strip ())#Remove the space before and after9 Print(s.lstrip ())#Remove the preceding
Python [spam] problems with the nan type, pythonnan
Today, when I wrote a piece of summation code, I found that the result of nan was finally returned. The cyclic summation code called three functions in sequence, and printed the return values of
Automated O & M: flask-bootstrap + highstock integration and highstock
1,
Load highstock. js in the base.html template of flask-bootstrap.The following is an example of calling a js file in the source code of base.html. File Path:
2, 31. Django Process
Django is a web framework written in python and complies with the design philosophy of MTV.
Implementation principle:
1. the browser initiates a request.
2. Django points to view (Views) based on the URL Conf)
3. view data
Summary of common string operation skills in Python and python Operation Skills
This example summarizes the common operations on strings in Python. We will share this with you for your reference. The details are as follows:
Returns a string.
>>> S =
Python uses Django to create a simple zhihu daily report API, pythondjango
Now I will teach you how to practice and make a simple daily report APIFirst, you must familiarize yourself with the basic usage of django, write models, write view functions,
OCR for PDF files based on Python,
Recently, when creating a project, you need to input a PDF file, output the text from it, and save the text to the database. For this reason, I found a long-term solution and finally decided to use it.Tesseract. So
Analysis of shard and truncation sequences in python,
Sequence Concept
In sharding rules, list, tuple, and str (strings) can all be called sequences and can all be sliced according to rules.
Slice operation
Note that the subscript 0 of the slice
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