Pay attention to this sectionCodeWhen a foreigner runs on Linux, the three sections run normally on the interface, while when I run on Windows2003, only the first two sections can run the results. I don't know what's going on. If any brother knows,
'''Created on 2013-1-29 @ Author: Administrator ''' def checkstreet (Zhan, A): for I in Zhan: If a = I: return 0 return 1 def DSF (a, B, Zhan, street, street2): L = Len (Zhan) L2 = Len (street2) if l = L2 and A = B: Print Zhan return 0 else: for I
This sectionProgramIs to count each partner and their occurrences from the given list.
Littlebuddys = ['jack', 'terry ', 'john', 'rooney', 'ross ', 'kzc', 'john', 'ross', 'ross ']
Novice programmer
D ={} for Buddy in littlebuddys: If Buddy not
In the game, I want to monitor and record the changes in the backpack in the item system. Assume that the storage structure of the backpack is like this. Is a dictionary, {item ID: quantity }. During the initialization of the backpack class, copy
The idea of functional programming. It can be understood as a function bound with some parameters. The function is to reduce the number of parameters, which is shorter and more concise. I previously made a user retention rate
Program. The
AlgorithmAnalysis:The spiral matrix is represented by a two-dimensional array. The coordinates (x, y) are (X axis and Y axis)The clockwise direction of the spiral is-> right, bottom, left, top, which is represented by a numerical value that is x
Word cloud is popular in your web pages.
Today, I find one simple way to generate word cloud by python.
Here, we use pytagcloud package. It is can be found by Google.
We used:
Python setup. py install
To install this package in python2.7
It is quite simple to allow the two graphics libraries to support Chinese display.
PIL supports Chinese characters:
1. copy a font file from the C: \ WINDOWS \ fonts \ directory of windows, such as "msyh. TTC "to a directory,
Although I have been using python for so long, I can still find out the "secrets" of some things that I thought were very familiar with on and off ".
Maxsplit parameters of Split ()> 'Hello, world, Foo, bar'. Split (',', 1) ['hello', 'World, Foo,
Before monitoring and warning, you need to send an email, which is very simple, just like breathing.
Import smtplibfrom email. mime. text import mimetext_user = "sigeken@qq.com" _ Pwd = "***" _ to = "402363522@qq.com" # Use mimetext to construct
Linux:
Use Vim as a text editor
Vim -- enter vim, press "I" to enter insert (insert text mode), and write the source program
Press ESC and enter ": WQ + source file name" -- save and exit Vim
When you enter vim, you can name the source file:
VIM +
String formatting
In python, the output tag is similar to the printf () format in C. In python, the % operator is used to format the output string. The common format is
Format mark string % value group to be output
The "format mark string" on
Access web pages through multiple Python threads
@ For & ever 2010-07-03
Use python to access webpages through multiple threads.A simple small example is to access three different pages with 20 concurrent threads on each page.
The Python
Unix users are familiar with the concepts of standard input, standard output, and standard errors. This section is prepared for others who are not familiar with it.
Standard output and standard errors (usually abbreviatedStdoutAndStderr) Is the
'''Created on 2013-1-28@author: Administrator'''def count(tempr, number, station, i, order): train = [k for k in range(0,station)] for n in range(0,station): train[n] = 0 price = (tempr[i][1]-tempr[i][0])*tempr[i][2] a = tempr[i][0
Reprinted: http://blog.csdn.net/noodies/article/details/6034105
In C/C ++/Java, main is the starting point for program execution. In python, there are similar running mechanisms, but the methods are quite different: python uses indentation to align
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