This time I updated a majority of the functions, which were developed in the form of an app.
Added the blog classification function; blog follow and recommendation function (Ajax implementation)
Added the second-level channel function.
More
1. If A = input () A = int (a) B = input () B = int (B) If A> B: Print (STR (a), "big") else: if (A
If you do not need (), write the judgment condition directly, and then follow a colon (:), else is also followed by a colon
If no {} indicates
Download an open-source code without makefile. There are only a lot of sconscript files. Remember that a tool called scons is used to build this file.
You have to install it.
Install Python first.
Assume that the installation directory is c: \
Def keywordThe custom function starts with the def keyword followed by the function name,
No {} in C #. End the function in indent mode.
In python, user-defined functions must be written before the call statement.
(Compilation seems to be
Python has several built-in sorting functions for sorting.
1.Sort list
You can use the built-in sort function to sort the python list.
>>> S = [2, 1, 3, 0]>>> S. Sort ()[0, 1, 2, 3]
>>> S. Sort (reverse = true)
[3, 2, 1, 0]
I think Google online translation is quite useful. If I want to write a small tool, I can use it locally. I found two tools on the Internet that are not very useful (using python to call Google translation; using Google translation for Python ),
Now
Http://www.pythonclub.org/python-basic/start
Http://my.oschina.net/captaintheron/blog/6437I. Python variable types
Python has a variable type, and it will forcibly check the variable type.
The built-in variable types are as follows:
# Integer
Import getoptImport sysDef usage ():Print ('''This is help message-H -- help show help info-I -- input the input file or directory-G -- grep words-T -- time modify time-V -- verbose show verbose Information''')PassDef main ():Try:Opts, argS = getopt.
1. If
There can be zero or moreElifParts, andElsePart is optional. The keyword'Elif'Is short for 'else if'
2.
>>> for x in a:... print(x, len(x))>>> for x in a[:]: # make a slice copy of the entire list... if len(x) > 6: a.insert(0, x)
3.
Python3.1 seems to be different from the previous 2.x version. At least print 'Hello world' is considered a syntax error and must be written as a function form -- print ("Hello World ")
1. Comments in Python start with the hash character,#, And
1. Defining modules
A module is a file containing Python definitions and statements. The file name is the module name with the suffix. PyAppended. Within a module, the module's name (as a string) is available as the value of the global variable_
Python supports the following data types: integer, floating point, plural, and string.
The plural value is represented by a "J" suffix. It can also be created through complex (Real, IMG. The real and virtual parts can be accessed separately. Like
1. Problems and Solutions when the default value of the function is mutable
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Def F2 (A, L = []):
L. append ()
Return L
Print (F2 (1 ))
Print (F2 (2 ))
Python is well known for its strict Structure and Its naming rules. It is especially confusing for developers.
Especially for python and Ruby dynamic languages, rule naming is particularly important because methods or attributes may increase or
The queue module implements Multi-producer, multi-consumer queues. it is especially useful in threaded programming when information must be exchanged safely between multiple threads. the queue class in this module implements all the required locking
Document directory
Introduction
Use thread queue
Use multiple queues
Introduction
For python, there is no lack of concurrency options. Its standard library includes support for threads, processes, and asynchronous I/O. In many cases, Python
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