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¼¼ÊõÈËÔ±²ÎÓë¸÷ÖÖ¼¼ÊõÊé¼®³ö°æ¡£
ͨ¹ý¸ÃÊé¼®£¬×÷Õß¿ÉÒԵõ½Èçϱ¨³ê£º
1¡¢·áºñµÄ¸å³ê¡£
2¡¢Êé¼®Öø×÷µÄÊðÃûȨ¡£
3¡¢¶Ô×÷ÕߺÍÊé½øÐÐÐû´«£¬Ìá¸ß×÷ÕßÔÚ¼¼ÊõȦ×ÓÀ ......
pythonµÄPIL¿â×Ô´øµÄ·½·¨Ö»ÄܽøÐоØÐεÄÇиÈç¹ûÎÒÓÐÁËÒ»¸ö¶à±ßÐθ÷¸ö¶¥µãµÄ×ø±ê£¬ÈçºÎ¶ÔÏÖÓеÄͼƬ°´ÕÕÕâ¸ö¶à±ßÐνøÐÐÇиîÄØ£¿
²»Ò»¶¨ÒªÓÃPIL¿â£¬ÈκÎÄÜʵÏÖÕâ¸ö¹¦Äܵķ½·¨¶¼ÐС£
ͼƬÇиîµÄjs²»ÊǺܶàÂð£¿
......
C#ÀïÃæÓÃusing System.Security.Cryptography; RSACryptoServiceProvider¼ÓÃܹýµÄÏûÏ¢
ÓÃPython CryptoÖÐRSAµÄ·½·¨ ÄÜÖ±½Ó ½âÂð£¿
RSA¼ÓÃÜ·½Ê½²»ÊÇͳһµÄÂð£¿ÐèҪעÒâЩʲô£¿
ÓаïÖú¡£µ«ÊÇû½â¾öÎÊÌâ¡£¡£¡£
......
×î½üÒ»¸öÏîÄ¿ÂíÉϾÍÒªÓÃPython±àÁË ´ó¼ÒÍƼö¸öIDE¡£¡£¡£
1 Ãâ·Ñ¡£¡£¡£
2 Ìå»ý×îºÃСһµã
3 ¹¦ÄÜÇ¿´ó
£¨ÅÅÃû²»·ÖÏȺ󡣡£¡£·Ï»°¡£¡££©
emacs,×î´óµÄÓŵãÊÇÒòΪ·ÇͼÐνçÃ棬ÓÃSSHÔ¶³ÌµÇ¼Ҳ¿ÉÒÔʹÓá£ËùÒÔ¿ÉÒÔÓ ......
code:
remote = urllib.urlopen(remote_file)
local_file = open(local_path_name, "wb")
local_file.write(remote.read())
ÎÊÌâ:
ÓÃÕâÖÖ·½Ê½¿ÉÒԺܺõÄÏÂÔØÔ¶³ÌÎļþ, ÏÖÔÚÐèÒª¼ÓÈëÒ»¸ö½ø¶ÈÏÔʾµÄ¹¦Ä ......