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

python ÖÐÎÄÎÊÌâ

Èç¹ûPythonÔ´ÎļþÖгöÏÖÖÐÎÄ£¬ÐèÒªÔÚÔ´ÎļþµÚÒ»ÐмÓÉÏÀàËÆÈçϵĴúÂëÒ³Ö¸Á
# -*- coding:gbk -*-
Èç¹û³ÌÐòµÄÔËÐнá¹ûÖаüº¬ÖÐÎÄ£¬¿ÉÒÔÔÚ³ÌÐò¿ªÍ·°üº¬ÈçÏ´úÂ룬¾Í¿ÉÒÔÕýÈ·ÏÔʾÖÐÎĽá¹û£º
    import sys
    reload(sys)
    sys.setdefaultencoding('gbk')


Ïà¹ØÎĵµ£º

pythonÄ£¿éÖ®ConfigParser: ÓÃpython½âÎöÅäÖÃÎļþ

ÔÚ³ÌÐòÖÐʹÓÃÅäÖÃÎļþÀ´Áé»îµÄÅäÖÃһЩ²ÎÊýÊÇÒ»¼þºÜ³£¼ûµÄÊÂÇ飬ÅäÖÃÎļþµÄ½âÎö²¢²»¸´ÔÓ£¬ÔÚpythonÀï¸üÊÇÈç´Ë£¬ÔÚ¹Ù·½·¢²¼µÄ¿âÖоͰüº¬ÓÐ×öÕâ¼þÊÂÇé
µÄ¿â£¬ÄǾÍÊÇConfigParser£¬ÕâÀï¼òµ¥µÄ×öһЩ½éÉÜ¡£
   
ConfigParser½âÎöµÄÅäÖÃÎļþµÄ¸ñʽ±È½ÏÏóiniµÄÅäÖÃÎļþ¸ñʽ£¬¾ÍÊÇÎļþÖÐÓɶà¸ösection¹¹³É£ ......

Ò»¸ö¼õÉÙ¶à½ø³ÌÏÂpythonÄÚ´æÕ¼ÓõÄС¼¼ÇÉ

¡¡¡¡ÔÚpythonÖÐÈç¹ûҪʹÓÃfork»òÕßmultiprocessÀ´×ö¶à½ø³Ì£¬¼ÙÈçimportµÄ¿âºÜ¶à»òÕߺܴó£¬ÀýÈçwxpython£¬²é¿´¸÷½ø³ÌµÄÄÚ´æÕ¼ÓÃÄã»á·¢ÏÖÁ½¸ö½ø³ÌµÄÄÚ´æÕ¼Óûù±¾ÉÏÏàͬ£¬»»¾ä»°Ëµ£¬Èç¹ûµÚ¶þ¸ö½ø³Ì¸ù±¾²»ÐèÒªÓõ½wxµÄÄÚÈÝ£¬ËüÒ²»á±»¼ÓÔØµ½ÄÚ´æµ±ÖÐÈ¥¡£¾ÍÄÃwxÀ´×öÀý×Ó£¬Ã»ÓÐimport t wxÕ¼Óôó¸Å8M+Äڴ棬һµ©import wx£¬ÄÚ´æÂíÉ ......

pythonдµÄÖ¡·Ö¸îº¯Êý

ǰһÕóÔÚдһ¸ö×Ô¶¯²âÊÔ³ÌÐòʱÐèÒª°´ÕÕÌØ¶¨×Ö·û¶ÔÊÕµ½µÄÊý¾Ý½øÐÐÖ¡µÄ·Ö¸î£¬Ô­ÓÐÒªÇóÊÇÓÐÿ֡ǰºó¸÷ÓÐÒ»¸öͬÑùµÄÌØÊâ×Ö·û,µ±Ê±¹À¼ÆÏÂʱ¼ä»¹¹»£¬Ï뽫ÆäÀ©Õ¹ÎªÒ»¸ö½ÏΪͨÓù¦ÄÜ£¬¼´Ã¿Ö¡Êý¾ÝǰÓи÷ÓÐÒ»¸öÌØÊâ×Ö·û±íʾ¿ªÊ¼ºÍ½áÊø£¬µ«Ç°ºóÕâÁ½×Ö·û¿ÉÒÔ²»Í¬£¬Ò²¿ÉÒÔÖ»ÓÐÒ»¸ö£¨ÔÚÍ·ÔÚβ·Ö¸îЧ¹û²»Í¬£©£¬Í¬Ê±Ñ§Ï°ÁËÒ»Õópython£¬¸Ð¾õÆ ......

Python±ê×¼¿â tracebackÄ£¿é

Example 2-18 չʾÁË traceback Ä£¿éÔÊÐíÄãÔÚ³ÌÐòÀï´òÓ¡Òì³£µÄ¸ú×Ù·µ»Ø
(Traceback)ÐÅÏ¢, ÀàËÆÎ´²¶»ñÒ쳣ʱ½âÊÍÆ÷Ëù×öµÄ. Èç Example 2-18 Ëùʾ. 2.11.0.1. Example
2-18. ʹÓà traceback Ä£¿é´òÓ¡¸ú×Ù·µ»ØÐÅÏ¢ File: traceback-example-1.py # note!
import
Example 2-18 չʾÁË traceback Ä£¿éÔÊÐíÄãÔÚ³ÌÐòÀï´òÓ¡Òì³£ ......

pythonͼÐδ¦Àí¿âPIL(Python Image Library)


Ô­ÎĵØÖ· http://www.javaeye.com/wiki/Python/1371-python-graphics-library-pil-python-image-library-introduction
¹ØÓÚPIL¿âµÄһЩ¸ÅÄî
pilÄÜ´¦ÀíµÄͼƬ
ÀàÐÍ
pil¿ÉÒÔ´¦Àí¹âդͼƬ(ÏñËØÊý¾Ý×é³ÉµÄµÄ¿é)¡£
ͨµÀ
Ò»¸öͼƬ¿ÉÒÔ°üº¬Ò»µ½¶à¸öÊý¾ÝͨµÀ£¬Èç¹ûÕâЩͨµÀ¾ßÓÐÏàͬµÄάÊýºÍÉî¶È£¬PilÔÊÐí½«ÕâЩͨµÀ½øÐеþ¼Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ