python ÈÕÖ¾ÎÊÌâ
ÎÒÔËÐÐһϳÌÐò£º
import logging
def initlog():
logger = logging.getLogger()
hdlr = logging.FileHandler('D:\log_fram.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.NOTSET)
return logger
if __name__ == "__main__":
loger = initlog()
loger.info("Now the come return of the king!")
²åÈëÎļþûÓÐÎÊÌ⣬µ«ÊÇΪʲôµÚÒ»´ÎÔËÐвåÈëÒ»Ìõ,µÚ¶þ´Î²åÈëÁ½Ìõ£¬µÚÈý´Î²åÈëÈýÌõ£¬ÒÔ´ËÀàÍÆ£¡
²»ÖªµÀÊÇʲôÔÒòÇëÖ¸½Ì£¡
ÊÔÁËÄãµÄ½Å±¾£¬Õý³£¶î£¬Ã¿´ÎÒ»Ìõ¡£ÎҵĻ·¾³ÊÇPython 2.6.3 for Windows XP¡£
Õâ¸úÎļþ´ò¿ªËùÓÃµÄ mode Óйأ¬Ä¬ÈÏÊÇÒÔ append ´ò¿ªµÄ
Python code:
class FileHandler( filename[, mode])
Returns a new instance of the FileHandler class. The specified file is opened and used as the stream for logging. If mode is not specified, 'a' is used. By default, the file grows indefinitely.
¼¸ÖÖÎļþµÄ´ò¿ª·½Ê½£¬Ò²Ö»ÓÐaÊʺϰ¡£¬Ä¬ÈϾÍÊÇa£¬²»Ð´Ò²Ã»ÓÐʲôÎÊÌ⣡
angel_su ˵¿ÉÒÔ£¬ÄÇÊÇʲôÔÒòÄØ£¡£¿
ÎÒÓõÄÊÇpython2.5.2&
Ïà¹ØÎÊ´ð£º
ÇëÎʸßÊÖ£¬pythonÀïµÄpopenÀàËÆjavaÀïµÄÄĸöÀà»òÕß·½·¨ÄØ£¿£¿ÁíÍâjython¿ª·¢java¸ÃÈçºÎʹÓÃjythonÄØ£¿£¿
1.¿ÉÄܺÍjavaÀïµÄRuntime.getRuntime().exec£¨"ϵͳÃüÁî"£©; Æô¶¯½ø³Ì
2.eclipseÏÂÔØjython ²å¼ ......
map£¬filter·½·¨Ó¦¸Ã»á·µ»ØÒ»¸öÁÐ±í¡£
µ«ÊÇÔÚÎÒÕâÀËüÃÇ×ÜÊÇ·µ»Ø£º
<map object at 0x0000000002A2C978>
<filter object at 0x0000000002A2C9E8>
ÎÒÓõÄpython3.1£¬ Õâ¸öÒ²Êǰ汾µÄ±ä¶¯µ¼ÖµÄÂ𣿠......
תÌû£º
import sys
from wxPython.wx import *
from wxPython.lib import newevent
DispatchEvent, EVT_DISPATCH = newevent.NewEvent()
class GenericDispatchMixin:
def __init__(self):
......