##author: Wuhao##爬取指定页码的图片, if you need to crawl all the pictures of a certain category, the overall frame will not change, but you need to analyze it separately#Import Urllib.requestImport Urllib.parseImport reImport OS#添加headerHeader=\{
Chinese
English
Chinese
English
Chinese
English
Chinese
English
Character encoding:
Character Encoding
Binary:
Binary
Variable:
Variable
Interaction:
Interaction
Recently it's like learning a bit of scripting language, everyone is recommending Python, ready to learn some python every day ~1. Python's execution process1) First compile the script into byte code2) Python virtual machine interprets and runs
1. Two ways to execute Python scripts(1), in Linux terminal, [[email protected] ~]# chmod +755 *.py #./py(2), [[email protected] ~]# python *.py2, briefly describe the relationship between bits and bytesone byte (byte) = 8 bit (bit)3.brief
Introduction to ModulesModule: Simply and rudely, it is a collection of code that implements a function with a mound code.Like functional programming and process-oriented programming, functional programming accomplishes a function, and other code is
1. Two ways to execute Python scriptsA,./run.py invoke the Python script directly at the command line;B, Python run.py calls the Python interpreter to invoke the Python script.2, briefly describe the relationship between bits and bytesBit: bits (BIT)
Jump out of the multilayer loop: three-layer loop, the innermost layer directly jumps out 3 layersMethod One:In Python, the function runs to return and stops, so you can use this feature to write functions as functions to terminate multiple loopsEF
Ctrl+d #复制所选的内容CTRL +? #注释选中的内容CTRL + again? #取消所选内容的注释Type password password is not visible:Import GetpassUsername=input ("username")Password=getpass.getpass ("passwd:")Data types of the same type can be manipulated, computed, for example: integers
Python Implementation delete a file or folder recently learned the knowledge of Python, and learn to crawl the content of the Web page knowledge, while learning when Python delete folder or file knowledge, I think this content is good , recommend
One, I/O operation:Open (Name[,mode]) is equivalent to file (Name[,mode])Mode Description:R to open a read-only file, the file must exist.r+ open a writable file, the file must exist.W Open Write-only file, if the file exists then the file length is
Source Insight unexpectedly does not support utf-8, in order to support the Chinese display, so write a Python applet will be a directory of all files from the Utf-8 transcoding to GBK
The code is as follows:
#!/usr/local/bin/python#-*-coding:utf-8-
SocketSockets are also commonly referred to as "sockets," which describe IP addresses and ports, and are a handle to a chain of communication, where applications usually make requests to the network through "sockets" or respond to network
Http://www.jb51.net/article/56490.htm(1) Os.systemRun system commands on only one sub-terminal and cannot get return information after command executionCopy CodeThe code is as Follows:System (command), Exit_statusExecute the command (a String) in a
Python uses Guetzli to batch compress images,
Google is now open-source again. This time, it opened up Guetzli, an image algorithm tool. Guetzli, a cookie in Swiss German, is a JPEG encoder for digital and web images, allows you to produce smaller
Django models operation database, djangomodels
1. Create a database and link a database
(1) Create a database in models. py
from django.db import modelsclass UserInfo(models.Model): nid = models.AutoField(primary_key=True) user =
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