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

[Ô­´´]PythonÄÚ´æй©²é¿´Æ÷ʵÏÖ

[Ô­´´]PythonÄÚ´æй©²é¿´Æ÷ʵÏÖ
by AKara 2009-04-23 @ http://blog.csdn.net/akara @ akaras@163.com
   
---------------------------------------------------------------------
  Ϊ¸üºÃ¶¨Î»PythonÄÚ´æй©Çé¿ö£¬Ð´ÁËÒ»¸öеÄPythonÄÚ´æй©²é¿´Æ÷Ä£¿é¡£
Ä£¿éÓÐÈçϹ¦ÄÜ£º
  * ½«ËùÓжÔÏó°´¿òͼÒýÓùØϵÊä³öpngͼƬ
  * ¿Éµ÷ÕûÊä³öÿÒýÓòã½ÚµãµÄ×î´óÊýÁ¿
  * ¿Éµ÷Õû驶ÔÏóÍùÉÏÒýÓõIJã´ÎÊýÁ¿
  * ¸÷ÖÖÀàÐͶÔÏóÓÃΨһµÄÑÕÉ«±êʶ
  * 驶ÔÏóÔÚÔ­ÑÕÉ«ÉÏȾºìÉ«
  * 驶ÔÏóÏà¹ØµÄlinkÓúìÉ«ÏßÌõ/ºìÉ«ÎÄ×Ö
  * ÓÃ<>Ìرð±êʶPython¶ÔÏóµÄÌØÊâ½á¹¹linkÎÄ×Ö
  ËùÒÔ£¬¸ù¾ÝÉÏͼ£¬ÐèҪȥ³ýÄÚ´æй©Ҫ×öµÄ¹¤×÷¾ÍÊÇ¡¾Ïû³ýºìÉ«¿ò¡¿£¬
×î¼òµ¥µÄ·½Ê½ÊÇ¡¾Ïû³ýËùÓкìÉ«link¡¿£¬µ«ÕâÏÔÈ»²»ÊÇ×îÓÐЧµÄ·½·¨————
×îÓÐЧµÄ·½·¨ÊǾ¡Á¿ÇжÏ"¶¥²¿"µÄlink(Ôõô²ÅËã"¶¥²¿"£¬ÒÀÀµ¹¦ÄÜÂß¼­Åж¨)¡£
---------------------------------------------------------------------
  PythonÌṩÁËgc.get_referrers·½·¨À´»ñµÃÒ»¸ö¶ÔÏóµÄÒýÓÃÕßÁÐ±í£¬ºÜ´ó³Ì¶È
ÉÏ£¬ÕâÒѾ­Íê³ÉÁËÄ£¿éµÄ50%µÄ¹¦ÄÜÁË£ºÒòΪֻҪwhileÑ­»·È¡µ½get_referrers
²¢Èë³öË«¶Ë¶ÓÁУ¬Ö±ÖÁ´¦ÀíΪ¿Õ¼´¿É¡£
  µ«ÊÇÔÚÊä³ö¶ÔÏóÒýÓùØϵµÄÓÐÏò±ßÐÅϢʱ£¬ÐèÒª×ÐϸµØ¶ÔtypesÄ£¿éÖÐËù
¶¨ÒåµÄ¸÷ÖÖÀàÐ͵ÄPython¶ÔÏó½øÐÐÇø±ð¶Ô´ý£¬ÉõÖÁÓÐЩPythonµÄÄÚ²¿¶ÔÏóÀàÐÍ
Á¬typesÄ£¿éÖж¼Ã»¸ø³ö£¬»òÁ¬Python ManualÊÖ²áÉ϶¼²»¶à˵һ¾ä :( £º
  (1)CellType: Ò»ÖÖÓÃÓÚÖ¸Ïòupvalue(LuaÖÐÕâÑù½Ð£¬¾ÍÕâÑù³Æºô°É)µÄ¶ÔÏó£¬
       Ëü¿É±»Ò»¸ö»ò¶à¸öclousureµÄfree var tupleÒýÓá£ËäÈ»Python²»Ï£Íû
       Ê¹ÓÃÕß×¢ÒâÕâ¸öÄÚ²¿µÄ¶ÔÏóÀàÐÍ£¬µ«ÊÇ¿ÉÒÔ×Ô¼º¶¯ÊÖÈ¡µÃ£º
       CellType = type((lambda x: lambda: x)(1).func_closure[0])
       
  (2)NewStyleClassType: ¾ÍÊÇnew style class(ºÍold style classÏà¶ÔµÄ)¡£
       ·í´ÌµÄÊÇPython´ÓÒýÈënew style classÒÔÀ´¾ÍÌᳫÞðÆúold style class
       (ÎÞÂÛ´ÓÐÔÄÜÉÏ£¬·½±ãÐÔÉÏ£¬¹¦ÄܶàÑùÐÔÉÏnew style class¾ùʤ)£¬µ«ÊÇ
       


Ïà¹ØÎĵµ£º

PythonÖеÄһЩÒì³£

ÆäʵÒì³£¾ÍÊDz»Õý³££¬¾ÍÊDz»ºÍÎÒÃÇÏëÏóÒ»ÑùÈ¥Ö´ÐС£ËüÊÇÒòΪ³ÌÐò³öÏÖÁË´íÎó¶øÔÚÕý³£¿ØÖÆÁ÷ÒÔÍâ²ÉÈ¡µÄÐÐΪ¡£Python³öÏÖÒì³££¬¾ÍÊÇÒòΪ¼ì²éÁËÒ»¸ö´íÎóʱ£¬Python½âÊÍÆ÷ÎÞ·¨¼ÌÐø¼ÌÐøÖ´ÐÐÏÂÈ¥£¬ÕâʱºòÅ׳öÁËÒì³£¡£ÍùÍùÕâ¸ö´íÎó·ÖΪÓï·¨ÉϺÍÂß¼­ÉÏ(²»Éó¤Ëµ¸ÅÄ-_-! )£¬¿´¿´¼¸¸öÀý×Ó£¬×ܽáһϣº
1¡¢NameError£º³¢ÊÔ·ÃÎÊÒ»¸öÎ ......

Èà easy_install ʹÓôúÀí·­Ç½°²×° Python Ä£¿é

ÀµÓºƣ¨http://laiyonghao.com£©
¹Ø¼ü×Ö£ºpython, easy_install, setuptools, myentunnel, polipo, windows, linux, socks5, http, proxy
ÒòΪһЩÖÚËùÖÜÖªµÄÔ­Òò£¬ÎÒÃÇÓÐЩÍøÕ¾ÎÞ·¨·ÃÎÊ£¬Ôì³ÉÉú»îºÍÉú²úµÄ¾Þ´ó²»±ã¡£ÆäÖжÔÎÒÓ°Ïì±È½Ï´óµÄÒ»¸ö¾ÍÊÇ°²×°Ä³Ð© Python Ä£¿éµÄʱºò£¬easy_install ÎÞ·¨·ÃÎʵ½ÍøÕ¾¡£ÔÚÕâÀï·ÖÏíÈ ......

PythonÒì³£´¦ÀíÌåϵ¼ò½é

PythonÄÚ½¨Òì³£Ìåϵ½á¹¹
BaseException
+--¡¡SystemExit
+--¡¡KeyboardInterrupt
+--¡¡GeneratorExit
+--¡¡Exception
+--¡¡StopIteration
+--¡¡StandardError
|¡¡¡¡¡¡¡¡+--¡¡BufferError
|¡¡¡¡¡¡¡¡+--¡¡ArithmeticError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡FloatingPointError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡OverflowError
|¡¡¡¡ ......

python»æÖÆÂÝÐýÏß

#coding=utf-8
from math import sqrt,cos,sin
import Image, ImageDraw
class SpireShape(object):
    def __init__(self, draw):
        self.draw = draw
        self.line_width = 1
     & ......

python pop3 ÊÕÓʼþ

def retrive_emails(pop3_server, user_name, passwd, server_port):
    #POP3
    pop_client = poplib.POP3(pop3_server, port=server_port)
    pop_client.user(user_name)
    pop_client.pass_(passwd)
   
    ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ