ObjectiveEmmm ... I've been playing with reptiles lately, but it's not so good ... May be I choose the difficulty is a bit high, so many pits ...Today in the study crawl pixiv on the leaderboard picture, is intended to climb their own attention to
First, the relevant module introductionSend mail mainly use smtplib and email two modules, here first on two modules for a brief introduction:1. Smtplib ModuleSmtplib. SMTP ([host[, port[, local_hostname[, timeout]])The SMTP class constructor, which
large python programs are organized in the form of modules and packages. The Python standard library contains a large number of modules. A python file is a module. 1. Standard modulepython comes with no need for you to install2. Third-party
There are two modules for Python processing time, which are times, datetime, calendar1> timePrint(Time.gmtime ())Print(Time.localtime ())#the current time is returned by a Time.struct_time objectPrint(Time.time ())#The time stamp of the current time
1. IntroductionSlightly2. Install PythonSlightly3. Initial steps(1) Get help ()
Help () use
1>>> Help (" Help")2 3Welcome to Python 2.7! This isThe online Help utility.4 5If this isyour first time using Python, you should definitely
Define a function that asks for the root of the two-yuan one-time equation # sublime Text import math def EE (a,b,c): Delta =b*b-4*a*c if delta 0: return
" null " else : M =math.sqrt (delta) NX = (-b+m)/2/
a ny
In Python, there is a difference between the assignment of an object and the copy (deep/shallow copy), which can produce unexpected results if used without notice.First of all, we should have the following knowledge about the assignment operation:
First, function is variabledef say (name): Print (name)YBQ = say #可以被赋值给其他变量YBQ (' amily ') #调用函数Function Name: Sayfunction Body: 1–2 lineReturn value: The value after returnMemory address of function: When the function body is read into memory,
ForeplayFirst of all, we must first understand what the various components of a class should be called.-Note: It may not be the same. About @propertyAs the name implies: it means ' attributes '.Role:1: Using it you will turn the class method into
Target page: http://www.axlcg.com/wmxz/1.html
First get the URL of each atlas on the first pageYou can see the URL of the atlas is really ul class Homeboy-ul Clearfix Line-dot under the A tag in Li, so we have to approach the target layer by
A dictionary is a key-value structure1. DefinitionD = {}D = dict ()D = {' A ': 1, ' B ': 2}D = dict ([' A ', 1],[' B ', 2]) #可迭代对象的元素必须是二元组, the No. 0 element of the two-tuple is key, and the 1th element is a VlaueD = Dict.fromkeys (range (5))
Homebrew
Homebrew is a software package management tool under Mac OS platform, which has many useful functions such as installing, uninstalling, updating, viewing, searching and so on.
Homebrew Common Commands
View Brew's help:
Disclaimer: The following code, Python version 3.6 runs flawlesslyFirst, the idea introductionDifferent image sites have different anti-crawler mechanisms, depending on the specific site to take the corresponding method1. Browser browsing analysis
Level 3 menu, can go to the next level, can retreat to the previous levelDate = {"1": {"one": {"111": ["A", "B"], "("): ["C", "D"],}, "12": { "121": ["E", "F"], "122": ["G", "H"]}}, "2": {}, "3": {}}exit_flag = Falsewhile No T exit_flag:for i in
Python 2 obtains the encoding of Chinese file names.
Problem:
Python2 obtains the file name containing Chinese characters. If the file name is not transcoded, garbled characters may occur.
Assume that the name of the folder to be tested is test.
Python implements the user management system, and python implements the Management System
The example in this article shares the code for implementing the user management system in python for your reference. The specific content is as
Summary of some tips on using python crawlers to capture websites.
Python has been used for more than three months, and the most common examples are crawler scripts: scripts that capture the local verification of the proxy, I wrote the script for
Python practice === python control keyboard and mouse: pynput, pythonpynputPython: pynput
Address: https://pypi.python.org/pypi/pynput
This library allows you to control and monitor input devices.
For each input device, it contains a sub-package
Use python to import the pymysql database to operate mysql (add, delete, modify, and query) and pythonpymysql
Install pymysql first. Run pip install pymysql on the command line.
After installation, connect to the mysql database:
Import pymysql.
Quick introduction to cookies and simple code examples in Python development, pythoncookie
Cookie: a key-Value Pair stored in the user's browser to solve the stateless connection of http. The server can write the cookie to the user's browser. Each
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