Package: folder, can have multilevelModule: PY FileIn Python, to avoid the names of different modules, you can put modules of the same name into different packages.1. How to differentiate between packages and normal directories:There must be a
1, first open the URL http://www.python.org/download/;2. Select the Window platform installation package in the download list.Find the last
Web-based Installer is required to complete the installation via networking
Executable installer is
Threading Process Introduction
Working minimum unit is thread
At least one of the processes---at least one thread
Application Scenarios:
IO-Intensive: ThreadingCompute Intensive: Process4. GIL, Global interpreter lock.Ensure
Borrowed from the predecessors of the blog, and then added a lot of things.which uses the subprocess module .>>> Import subprocess>>> p = subprocess. Popen (' Df-h ', stdin=subprocess. Pipe,stdout=subprocess. Pipe,stderr=subprocess. Pipe,shell=true)#
1, the use of the collection:Operation #1, Collection: List_1 = [1,4,5,7,3,6,7,9]list_1 = set (list_1) #创建集合list_2 = set ([ 2,6,0,22,66,8,4]) print (List_1,type (list_1), list_2) print (List_1.intersection (list_2)) #取两集合的交集print (list_1.union
Learn and use Python also has more than 2 years, has been in the cnblogs to find a variety of problems in the solution, has not really recorded their own learning, thinking of the drip, starting from today to share their own learning or practice,
Environment Preparation:1. Installing the Paramiko module2, the server SSH service to open port number 22ndbelow, please see the code#!/usr/bin/py#-*-Coding:utf-8-*-Import ParamikoSSH = Paramiko. Sshclient ()#实例化类Ssh.set_missing_host_key_policy
Add (add Element)
name = set ([' Tom ', ' Lucy ', ' Ben ']) name.add (' Juny ') print (name) #输出: {' Lucy ', ' Juny ', ' Ben ', ' Tom '}
Clear (Empty all elements)
name = set ([' Tom ', ' Lucy ', ' Ben ']) name.clear () print (name) #输出: Set
English documents:
GetAttr (object, name[, default])
Return the value of the named attribute of object. Name must is a string. The If the string is the name of the one of the object ' s attributes, and the result is the value of this
English Documents:
help([object])
Invoke the built-in Help system. (This function is intended-interactive use.) If no argument is given, the interactive Help system starts on the interpreter console. If The argument is a string and then the
NumPy Introduction
The presence of NumPy makes Python a powerful matrix computing power, no less than MATLAB.Official documents (https://docs.scipy.org/doc/numpy-dev/user/quickstart.html)
Introduction to various usages
The first is the data type in
I am using pycharm to develop the Django program, the way to print the debug program is still a bit cumbersome and not intuitive, so the study of the breakpoint debugging methods are as follows:
1. Open your project and find Run-->edit
Tuple (tuple):
Tuples are often denoted by parentheses, i.e.: (), the element with a comma, is the identity of the tuple.
1 #定义一个元组 2 3 #tuple = ' A ', 4 5 tuple = (' A ', ' B ', ' C ', ' d ', ' e ', ' f ', ' G ') 6 7 #常规来说, once a tuple has
The first learning crawler technology, in the knowledge of how to climb to the embarrassing encyclopedia of the jokes, so I intend to do a.
Achieve the goal: 1, crawl to the embarrassing encyclopedia of the jokes
2, realize every time you crawl a
Borrowed from the predecessors of the blog, and then added a lot of things.
which uses the Subprocess module.
>>> Import subprocess
>>> p = subprocess. Popen (' Df-h ', stdin=subprocess. Pipe,stdout=subprocess. Pipe,stderr=subprocess.
Scripts can be executed on any machine (need to install MySQL, at least MySQL client, MySQL only version 5.6 and above), first enter the source IP, detect the source IP on the normal operation of MySQL, and then in the local dump MySQL database, It
This article mainly describes the use of Python to generate XML methods, combined with specific examples of detailed analysis of Python generated XML file specific fluency and related considerations, the need for friends can refer to the
Have seen two functions assigned to a variable form, one isA=fThe other isA=f ()These two forms are differentiated and summarized separately.the 1.a=f type belongs to the Variable-pointing function .Verify with Code:>>> f = abs>>> f(-10)10The
Windows 10 python 3.5 Scrapy installation and configuration, Windows 10scrapy
I have been learning and using python for more than two years. I have been searching for solutions to various problems in cnblogs and have not yet recorded my learning
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