1 Listand theTuple1.1 List(ordered repeatable modifiable)A list is an ordered set of elements that can be added and removed at any time. >>> list=[1,2,3]>>> List[1, 2, 3]>>> list=[' 1 ', ' 2 ', ' 3 ']>>> List[' 1 ', ' 2 ', ' 3 ']>>> len
Python bottle Framework
Brief introduction:
Bottle is a fast, concise, lightweight, wsig-based, mini-web framework that consists of only one. py file, which does not rely on any other modules, except for Python's standard library.The
Keyboard input:python2.7Raw_input ()Python3Input ()Keyboard input defaults to a string, which can be used to implement type conversions, such as int (input ()).' Ciphertext ' input:Python-only command mode is availableImport GetpassPassword =
Single-Case mode1 singleton = "Only one single case"2 static methods + static fields3 Use singleton mode for all instances of medium-turn contentClass Sqllite: __instance=none def __init__ (self): self.ip= "127.0.0.1" self.port=
Object-oriented section II highlights:1. Encapsulation, objects nested within objects2. Pickle,load, remember, you must first import the relevant classesReview the previous section:Object-oriented three major features:Encapsulation, inheritance,
Open Operation fileR: Open in read mode, default is this modeW: Open in write modeA: Open in Append moder+: Open in read-write modew+: Open in read-write modeA +: Open in read/write modeRB: Open in binary read modeWB: Open in binary write modeAB:
A tuple belongs to a sequence1. The sequence consists of 3strings, lists, and tuples are sequences.The two main features of a sequence are all operators and slice operators.A. The index operator allows us to grab a specific item from the sequenceB.
Python data typeNumericalStringListMeta-groupDictionary1.1 Types of numeric valuesPlasticLong integer typeFloating point numberPlural classString type, there are 3 ways to define:There is no difference between single and double quotes in Python,
I. INTRODUCTIONPython outputs the output as a tabular format through the prettytable module, and Python itself is not built-in and requires a separate installation of the third-party library.Two. InstallationWay One: Pip installation>>> pip Install
In-depth analysis of multi-process, multi-thread, and coroutine in python, analysis of python
Process and thread history
We all know that computers are composed of hardware and software. The CPU in the hardware is the core of the computer, which
Lambda expressions in python: pythonlambda
This article describes the usage of lambda expressions in python. We will share this with you for your reference. The details are as follows:
Here we will introduce lambda functions.
Lambda functions are
A list of Python Data Types
I. Basic Data Types
Integer: intString: str (Note: \ t is equal to a tab key)Boolean value: boolList: list (set of elements)List []Ancestor: tupleAncestor use ()Dictionary: dictNote: All data types exist in the desired
Python is a simple example of fast Sorting Algorithm and de-duplication fast sorting.
Quick sorting is often used because the sorting efficiency is high in several sorting methods that are the same as O (N * logN.
The basic idea of this method is:
1.
When Python processes JSON, the value error and encoding error can be solved.
1. ValueError: Invalid control character at: line 1 column 8363 (char 8362)When json. loads (json_data) is used, the following error occurs:
ValueError: Invalid control
Python uses the smtplib module to describe how to send emails, pythonsmtplib
1. log on to the SMTP serverFirst, use the method on the Internet (here 163 mailbox is used, smtp.163.com is the smtp server address, and 25 is the port number ):
import
Introduction to scrapy1.1 and scrapy1.1
Today, we have successfully installed scrapy and tested it. It takes a long time to complete the verification.
In fact, the best teacher is scrapy's help document. As long as you read and follow the document,
Python built-in module-re, python module-re
To use regular expressions in python, You need to first import the re module. Regular Expressions are a powerful function that can save us a lot of work.1. metacharacters: Use Symbols with special meanings
Deploy Django in Apache in Windows, apachedjango
Win7/Apache/Python2.7/Django1.9 Web environment deployment: Windows7Apache httpd-2.4.16-win64-VC14Python2.7.11Django1.9.7 1, install Apache1) download the relevant components steps refer to the http:
Simple example of common python Regular Expression usage, python instance
The following lists the matching usage of Python Regular Expressions:
1. test whether the regular expression matches all or part of the string.
Regex = ur "" # Regular
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