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

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

PythonÄÚ½¨Òì³£Ìåϵ½á¹¹
BaseException
+--¡¡SystemExit
+--¡¡KeyboardInterrupt
+--¡¡GeneratorExit
+--¡¡Exception
+--¡¡StopIteration
+--¡¡StandardError
|¡¡¡¡¡¡¡¡+--¡¡BufferError
|¡¡¡¡¡¡¡¡+--¡¡ArithmeticError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡FloatingPointError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡OverflowError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡ZeroDivisionError
|¡¡¡¡¡¡¡¡+--¡¡AssertionError
|¡¡¡¡¡¡¡¡+--¡¡AttributeError
|¡¡¡¡¡¡¡¡+--¡¡EnvironmentError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡IOError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡OSError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡+--¡¡WindowsError¡¡(Windows)
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡+--¡¡VMSError¡¡(VMS)
|¡¡¡¡¡¡¡¡+--¡¡EOFError
|¡¡¡¡¡¡¡¡+--¡¡ImportError
|¡¡¡¡¡¡¡¡+--¡¡LookupError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡IndexError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡KeyError
|¡¡¡¡¡¡¡¡+--¡¡MemoryError
|¡¡¡¡¡¡¡¡+--¡¡NameError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡UnboundLocalError
|¡¡¡¡¡¡¡¡+--¡¡ReferenceError
|¡¡¡¡¡¡¡¡+--¡¡RuntimeError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡NotImplementedError
|¡¡¡¡¡¡¡¡+--¡¡SyntaxError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡IndentationError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡+--¡¡TabError
|¡¡¡¡¡¡¡¡+--¡¡SystemError
|¡¡¡¡¡¡¡¡+--¡¡TypeError
|¡¡¡¡¡¡¡¡+--¡¡ValueError
|¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡+--¡¡UnicodeError
|¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡+--¡¡UnicodeDecodeError
|¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡+--¡¡UnicodeEncodeError
|¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡+--¡¡UnicodeTranslateError
+--¡¡Warning
+--¡¡DeprecationWarning
+--¡¡PendingDeprecationWarning
+--¡¡RuntimeWarning
+--¡¡SyntaxWarning
+--¡¡UserWarning
+--¡¡FutureWarning
+--¡¡ImportWarning
+--¡¡UnicodeWarning
+--¡¡BytesWarning
²¶»ñÒì³£µÄ·½Ê½
·½·¨Ò»£º²¶»ñËùÓеÄÒì³£
¡¡'''¡¡²¶»ñÒì³£µÄµÚÒ»ÖÖ·½Ê½£¬²¶»ñËùÓеÄÒì³£¡¡'''
try:
a¡¡=¡¡b
b¡¡=¡¡c
except¡¡Exception,data:
print¡¡Exception,":",data
'''Êä³ö£º£¼type¡¡'exceptions.Exception'£¾¡¡:¡¡local¡¡variable¡¡'b'¡¡
referenced¡¡before¡¡assignment¡¡''
·½·¨¶þ£º²ÉÓÃtracebackÄ£¿é²é¿´Òì³££¬ÐèÒªµ¼ÈëtracebackÄ£¿é
'''¡¡²¶»ñÒì³£µÄµÚ¶þÖÖ·½Ê½£¬Ê¹ÓÃtraceback²é¿´Òì³£¡¡'''
try:
a¡¡=¡¡b
b¡¡=¡¡c
except:
print¡¡traceback.print_exc()
'''Êä³ö


Ïà¹ØÎĵµ£º

ʹÓÃPython´¦ÀíExcel±í¸ñ

http://cocobear.info/blog/2009/01/16/use-python-deal-with-excel/
ʹÓÃPython´¦ÀíExcel±í¸ñ 2009Äê01ÔÂ16ÈÕ
¸ø°³µÄbossдµÄÒ»¸öС¹¤¾ß£¬Ê¹ÓÃPython¶ÔExcel½øÐÐͳ¼Æ£¬È»ºó°Ñ½áÊøÉú³ÉÒ»¸öеÄExcel±í¸ñ£¬Ê¹Óõ½ÁËxlrdºÍpyExceleratorÁ½¸ö¿â¡£
¼òµ¥µÄ½éÉÜÒ»ÏÂÕâÁ½¸ö¿â£¬ÏÈ˵xlrd£¬Õâ¸ö¿â¶ÁExcel±È½Ï·½±ã£¬¸÷ÖÖ·½·¨Ê¹ÓÃÆ ......

pythonдµÄ½«Ò»Ð©ÀàÐ͵ÄÎļþѹËõΪ7z¸ñʽ

#½«Ò»Ð©ÀàÐ͵ÄÎļþѹËõΪ7z.py
#for folder all file do 7z
import os
import sys
import distutils.file_util
def ImportOkFile():
    if(os.path.isfile("D:\\Records\\½«Ò»Ð©ÀàÐ͵ÄÎļþѹËõΪ7z_record.txt")==False):
        f=open("D:\\Reco ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ