ËÄÜÌṩһ¸öpython¹ú¼Ê»¯µÄÀý×Ó
ÏÖÔÚÕâ¸öÏîÄ¿ÒªÓõ½ ¹ú¼Ê»¯£¬ÕÒÁ˺þã¬Ò²Ã»ÓÐÕÒµ½ºÃµÄÀý×Ó¡£ Ëѵ½Ò»²¿·ÖgettextµÄÀý×Ó£¬µ«Óе㿴²»¶®¡£ Çë¸÷λ´óϺָµãÏ£¿
http://blog.chinaunix.net/u/30664/showart_237334.htmlÒýÓà http://blog.chinaunix.net/u/30664/showart_237334.html ÎÒÊÔÁË£¬µ«Êǽá¹û²»¶Ô°¡£¬ ¡°½«²½Öè1Éú³ÉµÄlang.poÎļþÖ±½ÓÉú³Élang.moÎļþ¿½±´µ½./locale/en/LC_MESSAGES/Ŀ¼ÏÂ,¡± ÕâÀï¡°Ö±½ÓÉú³É¡±Ö¸µÄÊÇÔõÑùÉú³É°¡£¿ »¹ÇëÖ¸µãÏ¡£Ð»Ð»£¡ ²Î¿¼¼´¿É£¬¼ÈȻԴÂëÊÇeÎÄ£¬ÄÇô²¢²»ÐèÒªeÎĵÄmo¡£Ò»°ãÎÒ´ÓËû˵µÄ²½Öè4¿ªÊ¼£¬ÏÈ_(),È»ºó²Åpygettext£¬ÕâÑùmsgid¾Í¶¼ÓÐÁË...ÒýÓà ÒýÓà 1 Â¥ thy38 µÄ»Ø¸´: http://blog.chinaunix.net/u/30664/showart_237334.html ÕâÀï¡°Ö±½ÓÉú³É¡±Ö¸µÄÊÇÔõÑùÉú³É°¡£¿ »¹ÇëÖ¸µãÏ¡£Ð»Ð»£¡ ------------------test.py-------------------- #!/usr/bin/env python # -*- coding: utf-8 -*- import gettext gettext.install('lang', './locale', unicode=False) gettext.translation('lang', './locale', languages=['cn']).install(True) print _('Hello world!') print _('Python is a good Language.') ---------------------------------------------- pygettext test.py Éú³É messages.pot cp messages.pot messages.po 編
Ïà¹ØÎÊ´ð£º
ÒÑÖªPython ÖУº s = unicode("²âÊÔ", "gb2312") s = u'\u6d4b\u8bd5' print s ²âÊÔ ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô³ÉGb2312µÄºº×ÖÄØ£¿ ÕÒµ½¸ö·½·¨ ......
ÇëÎÊÏ£¬ÎÒµÄÊÇpython2.5°²×°ÁËPILÄ£¿é£¬È»ºó±àд³ÌÐò´ò¿ª±¾»úÉϵÄÒ»¸öͼƬʱ£¬ÎªÊ²Ã´ÀϳöÏÖ´íÎóÄØ£¬ÀÏÊÇÕÒ²»µ½Í¼Æ¬£¬´íÎóÌáʾÈçÏ£ºFile "C:\Python25\Lib\site-packages\PIL\Image.py", line 1888, in o ......
´ó¼ÒºÃ£¬ÎÒÊÇÒ»¸öÐÂÊÖ£¬¸Õ¿ªÊ¼Ñ§python£¬µ«ÊǸտªÊ¼µÄhelloworld¶¼Ã»·¨´òÓ¡£¬ÈÃÎÒºÜÎÞÄΡ£ ÎÒµÄpython°²×°Â·¾¶Îªf:\python31¡£ÔÚpathÖÐÒ²ÉèÖöÔÁË£¬ÔÚwindowsÏÂÔËÐÐÊÇÕâÑùÏÔʾµÄ£¬Ï£Íû¸÷λǰ±²Ö¸µãһϡ£Ð»Ð» Pyth ......
ÎÒÏÖÔÚÓÐÒ»¸öÐèÇóÊÇÕâÑùµÄ ÎÒÓÐ2¸öÀà class A { public: int val; } class B { public: A a } ÏÖÔÚÔڽű¾ÖÐÖ»ÄÜ b.a.val = 1 ÎÒÔÚpythonÖÐÏëʹÓà b.a = 1 ......
ÎÒÃǵÄÏîÄ¿ÐèÒªÔÚmfcÖбàÒëpython½Å±¾²¢Éú³ÉexeÎļþ£¬Òò´ËÐèÒªÔÚ³ÌÐòÖÐǶÈëpython½âÊÍÆ÷£¬Í¬Ê±ÓÉÓÚÓõÄpygameÄ£¿é£¬Ò²ÐèҪһͬ¼ÓÈë½øÈ¥¡£ÎÒÒѾ±àÒëÁËpythonÔ´Îļþ£¬ÓпâÎļþºÍdllÎļþ£¬µ«ÊÇpygame²»ÖªµÀÔõô¼Ó½øÈ¥¡ ......