One, download subline text 3Official website:HTTP://WWW.SUBLIMETEXT.COM/3The installation process is slightlySecond, generate the package Control interfaceThe advantages of ST3 's tools are lightweight, simple tools. So sometimes you need to rely on
Standard if conditional statement syntaxIf expression:If_suiteIf the expression is not a value of 0, the code group If_suite is executed, or the next statement is executed>>>if3 > 1:... Print 'OK'... Print 'Yes'. .. okyes>>>if3 > 1:...
This article focuses on some simple operations for collectionsSets are divided into mutable sets and immutable setsVariable set (non-hash)S={1,'a', (+/-),} # equals set ({1, ' a ', (+/-),})Add ValueS={1,'a', (All-you-do),}print(s) s.add ('123 '
In the previous article, we briefly described how to open a file, as well as read, write, and append actions, and Click here to view.In this article, we continue to introduce another way to open a file and several simultaneous read and write
There are two ways to format a Python string, one is in the format string "%", the other is the Format function formatting, the latter how to use I do not know.Formatting action SymbolsThere are several general formatting operators:%c converted to
Reading Chinese documents, such as excel,csv files, requires Chinese encoding such as GBK decoding in order to turn Unicode; however, data mixing type, reading CSV file will be error, operation of Excel Normal.Unicodedecodeerror: ' GBK ' codec can '
The map function in PythonMap () Python built-in high-order functions, he receives a function f and a list, and by the function f on each element of the list, to get a new list and return.Note: The map function does not change the original list, but
Tag: Print IMA character returns default str using blog divFor example:" What the ^_^ "You can use the Shard character and the step character: to fragment and define steps for a stringString ="What the ^_^" #return all By
The ability to implement super () and Init () is similar for single-inheritance
Class Base (object): def init (self): print ' base create ' class Childa (base): def init: print ' Creat A ', base.init (self) class childb
The enumerate function iterates through the elements in the sequence and their subscripts, and is used to get a count in the For loop, the enumerate argument is a variable that can be traversed, such as a string, a list, etc.
In general, when you
The collections is a python built-in module with source code located in lib/collections/init.py, which provides a common data container.
Deque Container Object
Introduced by the From collections import deque, when you create a Deque container
This article mainly describes the implementation of the search based on Python to see who deleted you the relevant information, the need for friends can refer to the following
Scenario: Find who deleted me, direct copy code saved to a Python file
Binary search tree (binary sort tree) its data structure for each node is 1 parent pointer, 1 left child pointer, 1 child pointers, there is their own data part, because only about two children, so called binary tree, on this basis, the two fork
The binary heap is a special heap, the binary heap is a completely two-dollar Tree (binary tree) or is an approximate complete two-yuan tree (binary tree). There are two types of binary heaps: the maximum heap and the smallest heap. Maximum heap:
This article gives you a summary of the Python 5 built-in data structure and operation examples, very detailed, the need for small partners can refer to.
One, List
A list is a data structure in which a series of items can be stored. List items are
1, block-level scope
Think about running the following program at this time will have output? Will execution succeed?
#块级作用域 if 1 = = 1: name = "Lzl" Print (name) for I in range: Age = i print (age)
Let's take a look at the
How do I read and write text files?
Practical cases
A text file encoding format is straight (such as Utf-8,gbk,big5), how to read these files in python2.x and python3.x respectively?
Solution Solutions
Note the differences between Python2 and Python3
This article is mainly for everyone to explain how Python read MySQL database table data, has a certain reference value, interested in small partners can refer to
The example of this article for everyone to share the Python read MySQL database
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