In the previous crawl through the picture has a little experience, based on previous experience again crawl Baidu Search interface imageNonsense don't say, first on the code#!/usr/bin/env python#-*-coding:utf-8-*-# @Time: 2017/7/22 10:44# @Author:
Online for multiple versions of the Python-compatible installation of the article gradually increased, are all in practice in the summary of experience. My installation after several repeated experiments or feel one of the more convenient.Some of
Building a commodity class, the __INIT__ function is similar to a construction method, and self is similar to thisimport Random class goods: def __init__ (self, Name self.name = name self.price = Price def changeprice (self self.price =
Why should there be tuples, () can hold multiple value tuples cannot be changed more is used to queryT = (1,[1,3], ' SSS ', (UP)) #t = tuple (1,[1,3], ' SSS ', ())Print (Type (t))Tuples can be a key to a dictionaryd={(+): ' Zcx '}Print (D,type (d),
Write CSV file source code:1 #output data written to CSV file2 ImportCSV3data = [4("Mike","male", 24),5("Lee","male", 26),6("Joy","female", 22)7 ]8 9 #Python3.4 New way to solve the problem of empty lineTenWith open ('D://write.csv','W', newline="')
A data structure: List tuple dict set1. Listlist01 = List () list01 = []A.append (object)A.extend (list)Del A[2]2. TupleContent cannot be changed, length cannot be modified TUPLE01 = (1,2,3,4)3. String4. DictKey must be an object that can be hashed (
1. Namespaces and ScopesNamespace: Where the name is stored, the exact name space is where the name and the value of the variable are bound.Namespaces have a total of three namespaces, both:1. Built-in namespaces: generated when the Python
Installing a third-party library appears Python version 2.7 required, which is not found in the registryCreate a file register.py content as follows.Import sysfrom _winreg import *# tweak as necessary version = Sys.version[:3]installpath =
Download Python FirstAddress: https://www.python.org/downloads/release/python-361/There are multiple versions in the download page:
Web-based Installer is required to complete the installation via networking
Executable installer is an
String type (str):Enclosed in quotation marks (single, double, and Triple), consisting of a string of characters.Use: Name, gender, address, education, passwordName = ' ZBK 'Value :First, make it clear that the string as a whole is a value, except
Use Linux+ipython,ipython to install during practicePython meta-character# Meta Characters:# . ^ $ * + ? {} [] \ | ()
. Match all characters except line break
\ metacharacters represent the matching
1. Strip () function
Function prototypesDeclaration: S is a string. RM is the sequence of characters to be deletedS.strip (RM): Remove the beginning and end of the S string. The characters in the RM delete sequenceS.lstrip (RM): Removes the
First, the Python line of code:
1 name = "Hello, world" 2 print (name)
Second, variable:
1 name = "SunDM12" 2 name2 = Name3 print ("My Name:", Name, name2) 4 5 name = "Wangba" 6 print (name, name2)
Name changes, and name2 = name has assigned "SunDM1
Learn a period of time flask, but has not done the deployment, so think about how to deploy it, think, first bar service to straightened out bar, so it is to think about the service to get up, here to choose is
Flask+uwsgi+nginx+ubuntu, Python is
1, there are four numbers: 1, 2, 3, 4, how many can be composed of different and no repetition of the number of three digits? What's the number? 2. The bonus awarded by the Enterprise is based on the profit commission. Profit (I) less than or equal
Packaging
1. Why encapsulation?
Encapsulation is to hide the specifics of the details of the data properties and methods, providing only one interface. Encapsulation can be used without caring about how the object is built
2. Encapsulation includes
Codingby default, Python 3 source files are encoded in UTF-8 , and all strings are Unicode strings. of course, You can also specify a different encoding for the source file:#-*-coding:cp-1252-*-IdentifierIdentifiers are composed of letters, numbers,
1, self-written module, can be directly added to the path.This makes it possible to call Directly.import sys 2, Single File module Copy files directly to $PYTHON_DIR/LIB 3, The Third-party library downloaded on the internet, after the general
The path to Python learning-day 1, the path to python learning dayPython Installation
Go to the official website to download the installation package and select your desired Python version. Python has already entered the 3. x era. It is best to
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