#-*-Coding:utf-8-*-"" "Created on Sat Oct 21:01:23 2016 @author: Hhxsym" "ImportRequestsImportJsonImportOsImportPymongoImportTime fromBs4ImportBeautifulSoup fromMultiprocessingImportPool #进程调用的包 inpath="C:\\Users\\Hhxsym\\Desktop\\Course
The first three blog has introduced, how to use selenium to crawl a specific content of Baidu Library article link and the name of the article, and then the main introduction of this blog is, for an article we should how to crawl all the content
1,
Given a sorted array, remove the duplicates in-place such so each element appear only once and return the new length.Do not allocate extra spaces for another array, and you must does this by modifying the input array in-place with O (1) Extra memo
1, the binary tree traversal mode.
Pre-sequence traversal: root or Left
In-sequence traversal: Zogen right
Subsequent traversal: Left and right root
Hierarchy traversal: From top to bottom, from left to right
2. Python creates a new binary tree and
in the morning to see a public number in the push Xgboost, LIGHTGBM, catboost principle comparison, on the Internet probably check the principle and interface use, currently only provide Python, R, C + + interface, and did not see the Java interface,
reading Files
Cases:
With open (' D://develop//new.txt ') as File_object:
contents=file_object.read ()
Print (contents)function open () opens a file that returns an object that represents a file that is stored in a variable that is later
The Python library contains several different types of components.
It contains data types, such as numbers and lists, that are often considered to be part of the language "core". For these types, the Python language core defines the form of text
Chenheo Yu Renco, play the man, not the cards. (https://www.zhihu.com/question/29521273) 36 people agree with me that you are using Windows, although many people recommend you to use Enthought and anaconda but that will deprive you of a lot of
For Python to invoke WebService only as a client, it is recommended to use the Suds library, which is quite lightweight and easy to use compared to zsi,soapy.
Installation suds is recommended for use with Easy_insall. Here are some of the official
1, pipleline Add the following code: (after the data crawl after the URL into the Redis to heavy)
Class Redisinsert (object):
def process_item (self,item,spider):
set_redis_values_1 (item[' url ')
Return item
2.
Python multithreading can only be concurrency, because it intelligently uses a CPU kernel
Multi-CPU parallel computing supported by the PP package under Python
installation
PIP Install pp
Use
#-*-coding:utf-8-*-Import math, sys, time import
Modules, exceptions, operating environments, MYSQLDBModule:Top-level files: As the entire file of the program portal, is responsible for calling other files in the code to implement the program flow function, called the top-level program
Sync Lockimport time, threadingdef addNum(): global num num -= 1num = 100thread_list = []for i in range(100): t = threading.Thread(target=addNum) t.start() thread_list.append(t)for t in thread_list: t.join()print(‘final num:‘, num)
Session and Cookie:Cookies: Keep the authentication status after login and save the data locallySession: Use cookies to mark the user, the cookie carries the session ID message, and the session can be found by checking the cookieThe cookie interacts
Python first knowledge and variables :variable Name:-- letter -- number -- underline "see the meaning of the name"(PS: Numbers do not start; they cannot be keywords; it is better not to repeat with Python built-in)-- Basics :"1" The first sentence
Then one of the above continues:How to Hide
Hide a property (set to private) in Python, starting with a double underscore
class A: __x = 1 # _A__x = 1 def __init__(self, name): self.__name = name # self._A__name = name
One, intro.1 What is data?x=10,10 is the data we want to store.2 Why data is divided into different typesData is used to represent States, and different States should be represented by different types of data.3 Data
Liao is very vague in the article, I only know that the HMAC is generated by Password+key, which is similar to the method of adding salt in the previous section.The following links are clearly explained by bloggers.52175431The HMAC algorithm is
Liao is very vague in the article, I only know that the HMAC is generated by Password+key, which is similar to the method of adding salt in the previous section.The following links are clearly explained by bloggers.52175431The HMAC algorithm is
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