The utilization of the multiprocessing process on a multi-CPU machine. And then wrote a script in i5 (4 cores), up 4 processes, found that only one CPU ran relatively high, and then feel not very comfortable.Specify a CPU to execute a process,
Background: This article is similar to the catalogue part of the article, in order to systematically learn Python new knowledge and review summarySummary:Python basic syntax"Fluent Python"
Tonight, I was bored to death. More than 9 o ' clock to work, just want to come back to read study, the result was nagging for an hour, I keep shouting don't chat with me, also repeatedly said. I just want to have a quiet look at books, study and
1. Learn Python's integral type2. Learn Python's floating-point type3. Learn the Boolean type of Python4. Learn the Python string and common methodsFloating-point Float notes:In floating-point operations, there are two ways to control the number of
Exercise: Flatten the following dictionary and output it to the target dictionary formatSource = {' A ': {' B ': 1, ' C ': 2}, ' d ': {' E ': 3, ' F ': {' G ': 4}}}target = {' a.b ': 1, ' D.F.G ': 4, ' D.E ': 3, ' A.C ': 2}Source = {' A ': {' B ': 1,
class Person (object):PassPerson.num = 888 Adding a property to a classDefault instance method, default parameter self, gets object information@classmethod Add a method default parameter CLS to a class, you can get the information in the
The following are common software packages developed by Python.
Name
Use
Installation commands
Opengl
sudo pip3 install Pyopengl
Pyqtgraph
GUI Graphics Library
sudo pip3
Tag: Phone class exists line execution character string named spanGlobal variables: Global variables can be accessed throughout the program scope.Local variable: A local variable can only be accessed within its declared function.Globvar= 0Def
1. Brief description of the relationship between BIT,BYTE,KB,MB,GB,TB1TB=1024GB; 1GB=1024MB; 1mb=1024kb:1kb=1024byte; 1byte=8bit 2. Brief description of the relationship between ASCII, Unicode, Utf-8, GBKAt first, ASCII encoding, one byte , up to 25
1, indentationerror:expected an indented blockCause: Python is very sensitive to indentationWorkaround: In which line of this problem is indented just fine, note that the tab cannot be mixed with the space, the next sentence with the colon is
S1 = ' ABCDEFG 'S2 = ' DEFABCDOABCDEFTW 'S3 = ' 1234a 'S4 = ' wqweshjkb 'S5 = ' DEFABCD 'S6 = ' J 'The S1, S3, S4, S5, S6 and the longest common substrings of S2 respectively are tested, and the efficiency of this function is measured in cases where
Threads & ProcessesFor the operating system, a task is a process, such as open a browser is to start a browser process, open a notepad started a Notepad process, open two Notepad started the two Notepad process, open a wordA word process is started.
Install MySQL-python: EnvironmentError: mysql config not found,
1. Run sudo yum install python-devel.
2 find/-name mysql_config found this file under/usr/bin/
3. Modify the site. cfg file under the MySQL-python-1.2.3 directory
Remove the comment
Django (register → log on → homepage) enhanced version, django enhanced version
First, prepare a blank data table:
Urls display:
Several main functions of views and the database link code: Explain
Back-end compilation ends the zookeeper
Data capture and analysis (python + mongodb) and pythonmongodb
Share something dry !!!
Python data capture and analysis
Programming module: requests, lxml, pymongo, time, BeautifulSoup
First, obtain the category URLs of all products:
1 def step ():
Twisted introduction and twisted Introduction
Twisted is an event-driven network engine framework implemented in Python. Twisted supports many common transport and application layer protocols, including TCP, UDP, SSL/TLS, HTTP, IMAP, SSH, IRC, and
Python functions,I. Functions
1. reduce repeated code
2. Easy to modify and expand
3. Maintain code consistencyIi. Function Format
Def function name ():
Function bodyIii. Naming rules for function names:
1. The function name must start with an
Python learning Common Good websites, python Learning
The following summarizes the URLs or resources that you commonly use when learning python, including the blogs of many people, so that you can find resources from this portal.
1.
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