This article brings you a detailed description of the multi-process in Python (code example), there is a certain reference value, the need for friends can refer to, I hope to help you.
This section is about learning Python's multi-process.
One,
This is a personal study note, non-tutorial, the content will be a bit confusing
Minimalist Tutorials
Data Type
We can use the type() function class to get the type of the object, the built-in data types in Python3 include:
Python's multiprocessing module is used to create multiple processes, and the following summarizes the usage records for multiprocessing.
Multiprocessing creating a multi-process comparison between Windows and Linux systemsFork ()
import ospid =
1. Supplementary data types 1, 1 tuplesWhen there is only one element in the tuple and there is no comma, the data type is the same as the element inside the parentheses.TU1 = (' Laonanhai ') tu2 = (' Laonanhai ') print (TU1, type (TU1)) print (TU2,
1. Create a CollectionCollections are created differently than the first two data structures.The collection is created by the set (Iterable) method, and the parameter iterable is an iterative object.Example code:S1 = set (' Learn every day ') #
The crawled Web page address is: https://movie.douban.com/top250When you open a webpage, you can see that TOP250 's movie is divided into 10 pages, each with 25 movies.Then to crawl all the movie information, you need to know the other 9 pages of
File operation steps: 1. There is a file, 2. Open the file, 3. Read and write the modified file, 4. Close the fileOne. one file: New or imported fileTwo. Open file: If it is the new file default and the py file in the same directory, if it is open
Linear table ApplicationsSolution to the problem of--josephus (Python version)Josephus problem Description: Suppose that there are n people sitting around a circle, now request from the K -person began to count off, the number of people reporting
The data's in-memory address is a reference to the data. If the two variables are the same reference, then the data corresponding to the two variables must be the same;if two variables correspond to the same data, the references are not necessarily
url = ' interface address 'r = Requests.get (URL) # send GET requestPrint (R.status_code) # Prints the status code, if redirected, returns the code after the redirectPrint (r.headers) # Prints the returned header (header)Print (r.text) # View the
1. TCP protocolReliable transmission, TCP packets do not have a length limit, theoretically can be infinitely long, but in order to ensure the efficiency of the network, usually the length of TCP packets will not exceed the length of IP packets, to
Here is a summary of several cases that will lead to coding problems, and explain one by one ...Case one: Chinese output is garbled?
# Python Version: 2.7.6
>>> string1 = "I love Fish C Studio"
>>> string1
' \xe6\x88\x91\xe7\x88\
CPython
The most widely used interpreter for C language development
IPython
An interactive timer based on CPython enhancements and CPython
PyPy
The goal is the execution efficiency. Use JIT
1. Basic ConceptsXML is a protocol that implements data exchange between different languages or programs, similar to JSON, but JSON is simpler to use.However, in ancient times, in the Dark Age when JSON was not yet born, you can only choose to use
Calendar is a module related to calendars, many types are defined in the Calendar module file, mainly Calendar,textcalendar and Htmlcalendar types. The calendar is the base class for Textcalendar and Htmlcalendar. The module file also provides a
1. Briefly describe the compilation process of the Python programming language.When the Python code is executed, the four processes "disassemble" Our code in the Python interpreter and are eventually returned to the user by the CPU execution. First,
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