Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PythonµÄ×Öµä²Ù×÷

 
PythonµÄ×Öµä²Ù×÷
PythonÌṩÁ˶àÖÖÓ¦ÓÃÓÚ×ÖµäµÄ²Ù×÷¡£ÒòΪ×ÖµäΪÈÝÆ÷£¬ÄÚ½¨lenº¯Êý¿ÉÒÔ½«×ֵ䵱×÷µ¥Ò»²ÎÊýʹÓÃÌýÇзµ»Ø×Öµä¶ÔÏóÖÐÏîÄ¿£¨¼ü£¯Öµ¶Ô£©µÄÊýÄ¿¡£
×Öµä»áÔ±
ÔÚPython2.2ÒÔ¼°ºóÃæ°æ±¾£¬DÖеÄkÔËËã·û¼ì²âÊÇ·ñ¶ÔÏókÊÇ×ÖµäDÖеļü¡£Èç¹ûÊÇ·µ»ØTrueÈç¹û²»ÊÇ·µ»ØFalse¡£ÏàËÆµÄ£¬
Ë÷ÒýÒ»¸ö×Öµä
×ÖµäDÖеÄÖµÓëÏà¹ØµÄ¼ük±»Ë÷Òý±íʾΪ£ºD[k]¡£Ë÷Òý×ÖµäûÓеļü»áÒýÆðÒâÍâ¡£ÀýÈ磺
d = { 'x':42, 'y':3.14, 'z':7 } 
d['x']                          
# 42
d['z']                          
# 7
d['a']                          
# raises exception
ƽÕû¸³Öµµ½Ò»¸öʹÓû¹²»ÔÚ×ÖµäÖеļüµÄË÷Òý£¨ÀýÈ磬D[newkey]=value£©ÊÇÒ»¸ö¿ÉÐеIJÙ×÷£¬¸Ã²Ù×÷¼ÓÔØ¼üºÍÖµµ½×ÖµäÀïеÄÏîÄ¿ÖС£ÀýÈ磺
d = { 'x':42, 'y':3.14, 'z':7 } 
d['a'] =
16                     
# d is now {'x':42,'y':3.14,'z':7,'a':16}
del
D[k]ÖеÄdelÓï¾ä£¬É¾³ý×ÖµäÖÐÓµÓмükµÄÏîÄ¿¡£Èç¹ûk²»ÊÇ×ÖµäDÖеļü£¬del
D[k]¾Í»áÒýÆðÒâÍâ¡£
×ֵ䷽·¨
×Öµä¶ÔÏóÌṩÁ˶àÖÖ·½·¨£¬Èçϱí¸ñËùʾ¡£·Ç±äÒì·½·¨·µ»Ø½á¹û£¬µ«²»¸Ä±äËüÃÇʹÓõĶÔÏó¡£ÔÚÏÂÃæÁбíÖУ¬DºÍD1´ú±íÈκÎ×Öµä¶ÔÏó£¬k´ú±íDÖÐÈκÎÓÐЧµÄ¼ü£¬xΪÈκζÔÏó¡£
·½·¨
ÃèÊö
Non-mutating methods
D.copy( )
Returns a (shallow) copy of the dictionary
D.has_key(k)
Returns True if k is a key in D, otherwise returns False
D.items( )
Returns a copy of the list of all items (key/value pairs) in
D
D.keys( )
Returns a copy of the list of all keys in D
D.values( )
Returns a copy of the list of all values in D
D.iteritems( )
Returns an iterator on all items(key/value pairs) in D
D.iterkeys( )
Returns an iterator o


Ïà¹ØÎĵµ£º

PEP 0263 Defining Python Source Code Encodings

 
PEP 0263
Defining Python Source Code Encodings
Python will default to ASCII as standard encoding if no other
encoding hints are given.
To define a source code encoding, a magic comment must
be placed into the source files either as first or second
line in the file, suc ......

eat python 003

Documentation for C's fopen():
---
r Open text file for reading. The stream is positioned at the beginning
of the file.
r+ Open for reading and writing. The stream is positioned at the
beginning of the file.
w Truncate file to zero length or create text file for writing. The
stream is posi ......

opencv python cool

µ±Äê×ö±ÏÒµÂÛÎĵÄʱºòopenCV¾ÍÏñÊÇÎÒµÄÈðÊ¿¾üµ¶£¬Ì«ÓиÐÇéÁË¡£Èç½ñÓÃÁËÒ»Äê¶àµÄpython£¬·¢ÏÖopenCVÒ²ÓÐpython°æ±¾ÁË£¬ÕæÊÇÌ«¿áÁË£¡µ±È»pythonÔÚ´¦ÀíͼÏñʱ»¹¿ÉÒÔÓÃÆäËü¿âÀýÈçPIL(Python Imaging Library )£¬Ò»ÖÖÇáÁ¿¼¶µÄͼÏñ¿â¡£Ä¿Ç°openCV1.0°æ±¾¶ÔÓ¦µÄpython°æ±¾Îª2.5£¬openCV2.0¶ÔÓ¦python 2.6¡£
¸½Â¼£º
1. һƪ½éÉÜͼ ......

pythonÄ£¿éÖ®poplib: ÓÃpop3ÊÕÈ¡Óʼþ

 
À´Ô´£º ×÷Õߣºzhaoweikid ·¢²¼Ê±¼ä£º2007-07-04 ÔĶÁ´ÎÊý£º
    pythonµÄpoplibÄ£¿éÊÇÓÃÀ´´Ópop3ÊÕÈ¡ÓʼþµÄ£¬Ò²¿ÉÒÔ˵ËüÊÇ´¦ÀíÓʼþµÄµÚÒ»²½¡£
    POP3ЭÒé²¢²»¸´ÔÓ£¬ËüÒ²ÊDzÉÓõÄÒ»ÎÊÒ»´ðʽµÄ·½Ê½£¬ÄãÏò·þÎñÆ÷·¢ËÍÒ»¸öÃüÁ·þÎñÆ÷±ØÈ»»á»Ø¸´Ò»¸öÐÅÏ¢¡£pop3ÃüÁîÂëÈçÏ£º
¡¡ÃüÁ ......

Python & XML


Chapter 1
Python and XML
Python and XML are two very different animals, each with a rich
history. Python is a full-scale programming language that has grown
from scripting world roots in a very organic way, through the vision
and guidance of Python's inventor, Guido van Rossum. Guido continue ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ