Source codeDownload: here
#039 while true: try: X = int (raw_input ('input a number :')) Y = int (raw_input ('input a number: ') Z = x/y comment t valueerror, Ev: Print 'That is not a valid number. ', ev counter t zerodivisionerror, EZ:
You may be familiar with dict. has_key () in Python ()
Today, I found a new usage: Key in dict. Keys ()
The results are the same ~
However, if you study it in depth, you will find that has_key () is a method earlier than python2.2. I haven't
Cx_freeze for python Packaging
Linux (RedHat 9.0... After a long time, I finally got this thing done :(. Cx_freeze with N versions won't work. If this is not the case, it will be wrong. There is no way at last, so I had to take the original
1. Download httpd-2.2.16-win32-x86-no_ssl.msi Installation
NOTE: If IIS is enabled, stop it.
2. Download mod_wsgi-win32-ap22py26-3.3.so
: Http://code.google.com/p/modwsgi/downloads/detail? Name = mod_wsgi-win32-ap22py26-3.3.so
3.
Import win32gui from RE import match def draw_line (): Print 'x1, Y1, X2, Y2? ' S = raw_input () If match ('/d +,/d + ', S ): X1, Y1, X2, y2 = S. split (',') X1 = int (X1) Y1 = int (Y1) X2 = int (X2) Y2 = int (Y2) hwnd = win32gui.
The configparser module reads and writes configuration files (such as. INI) in Python.
By Saya, (Ayi has slightly changed this article)
Http://hi.baidu.com/saya_sj/blog/item/b68ea92ea82ced594fc22619.html
For example, the userinfo. ini file
I was finding that I needed a progress indicator for Linux and Windows console applications that cocould be used to show the user that work was progressing and how much of the total work that had been completed. I finally broke down and wrote this
Method for viewing Python keywords: ikeycn and
Python
Related
Introduction: This is a detailed page for viewing Python keywords. It introduces the knowledge, skills, experience, and some Python source code related to methods used to view Python
I have learned a little about monkeyrunner recently. It is purely personal analysis. please correct me if there is any inaccuracy.
For more information about monkeyrunner, visit the official website. For more information about the introduction,
Original address: http://development.finetooth.com /? P = 11
Demo address:
http://development.finetooth.com/wp-content/uploads/FileUpload/weblib/HTMLForm/HTMLFormFileUploadTest.php?module=htmlform_fileupload_test
The Python file input CGIAbout four
I have never liked the animal "snake" since I was a child. In my eyes, it is always disgusting and terrible (Declaration: If I don't like it, it doesn't mean I want to kill it ). However, this does not affect my access to Python. When I see the word
#010 # For as a counter # in the C language of the class: for (I = 0; I for I in range (1, 11): print I else: # This else for is also optional Print 'For Loop ended/N' # End of for # As Traversal for # equivalent to foreach in C # and Java
Author: ShaneSource: http://bluescorpio.cnblogs.com
Lxml takes all the pain out of XML.Stephen Richter
Lxml is the most abundant and easy-to-use library for working with XML and HTML in Python. Lxml is a python-based binding between libxml2 and
In a word dictionary, you only need to save the frequency of the part-of-speech of a word. In addition, considering that reading a dictionary into memory at a time consumes too much, you must divide the dictionary into multiple parts.
. To meet this
Create a "queue" Object
Import queueMyqueue = queue. Queue (maxsize = 10)
The queue. Queue class is the synchronization implementation of a queue. The queue length can be unlimited or limited. You can set the queue length through the optional
Use existing cookies to access the website
Import cookielib, urllib2
Ckjar = cookielib. cookillacookiejar (OS. Path. Join ('C: \ Documents and Settings \ Tom \ Application Data \ Mozilla \ Firefox \ profiles \ h5m61j1i. default', 'cookies.txt '
Enumerate ()
A new built-in function,Enumerate (), Will make certain loops a bit clearer.enumerate(thing), WhereThingIs either an iterator or a sequence, returns a iterator that will return(0, thing[0]),(1, thing[1]),(2, thing[2]), And so forth.
A
At the beginning, I learned python. Listen to the recommendations of senior colleagues and play with Python challenge.
Actually, you can use various languages, but when you finish reading others' answers, you will find how simple and elegant 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