Because a function is also an object, and a function object can be assigned to a variable, the function can also be called through a variable.>>> def now (): ... Print ('2015-3-25'>>> f=now >>> F 0x7f84f14fda28>>>> f ()-3-The function object
Python __name__ = ' __main__ ' role, what the hell?There is a phrase that sums up the meaning of this code in a classic way:"Make a script both importable and executable"It means that the script module that you write can be imported into other
RecursiveWhat is recursive #recursion recursion A function calls itself internally There is a limit to the number of recursive layers in Python.Decoupling to complete a complete function, but the size of this feature should be as small as
One: The depth copy: s = [[], 3, 4] S1 = S.copy (), s1[0][0] = 8, print (s), print (S1), two results are [[8,1], 3, 4] The first is because the list can be modified, and then a pointer has a relationship, the figure is as follows:A shallow copy
Day2 Content
Binary and coded
1. Binary and encodingThe Python interpreter encodes the content when it loads the code in the. py file (default Ascill)ASCII (American Standard Code for Information interchange, United States Standards
Open (R ' C: \ ... ') when opening a filePlus R and no ' R ' are different' R ' is to prevent character escaping if ' \ t ' in the path does not add r, then \ t will be escaped and added ' R ' after ' \ t ' can retain the original appearanceThe
Hello world!
Simple Interactive (interactive, file-style) textbook P19
The user enters two numbers and calculates and outputs the sum of two digits:
The user enters the triangular three-side length and calculates the area of the triangle:
Main content
Module Introduction
Time and DateTime modules
Random
Os
Sys
Shutil
JSON and Picle
Shelve
XML processing
Hashlib
Re-regular expression
Module Introduction 1. DefinitionModules: Used
#-*-coding:utf8-*-"""Producer and Consumer models:1. There is many producers and consumers at the same time, but they complement all other.Implemented by Message Queuing to achieve at the same time production and consumpion processing."""Import
Import contextlib@contextlib.contextmanagerdef myopen (file, mode): F = open (file, mode, encoding= "Utf-8") Try: Yield F finally:f.close () with Myopen ("01-thread.py", ' R ') as F:print (F.read ())Here we use the Python contextlib module to
When the Fidder parsing tool is turned on while the crawler is being written, access to the target site encounters the following error:File "C:\Users\litao\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\adapters.py", line 506,
introducedIn a Python program, if we manipulate the value of a variable to do the operation, and we want to use the value of the original variable to do the operation at the next call, then we need to do a backup of this variable, which is the
Deepin system deploy the development and running environment of Python3.5, deepinpython3.5
Deploy the development and running environment of Python3.5 in the deepin System1 Overview
I am a newbie. I recently want to learn python interface automated
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