IronPythonÖÐÈçºÎÌí¼ÓPythonÄ£¿é?
IronPythonÖеŦÄÜÌ«ÉÙÁË,ºÜ¶à³£ÓõÄPythonÄ£¿é¶¼Ã»ÓÐ,Ò²¼ÓÉϲ»¡£
»¹µÃÓÃCLRÀ´À©Õ¹¡£
¸ãµ½·½·¨ÁË,ÈçÏÂ:
Python code:
import sys #µ¼Èësys module£»
sys.path.append("c:/Python24/Lib") #Ôö¼ÓËÑË÷·¾¶£¬Ò²¾ÍÊÇ˵µ±importij¸ömoduleµÄʱºò£¬½«»áµ½ÒÑÓеÄËÑË÷·¾¶ÖвéÕÒ£»
import random #µ¼ÈëCPythonÖÐÃûΪrandomµÄmodule£»
random.__doc__ #ÏÔʾģ¿éµÄdocument£»
ÎÊÌâÒѾ½â¾ö,Òª½áÌûÁË,˻ظ´»ý·Ö¾Í¾Í¸øË
ºÜ¶à¶¼Ã»ÓеÄ,²»ÒªÆæ¹ÖÁË,ÕâÒ²ÊǾٸöÀý×Ó°ÕÁË.
Âé·³µÄÊÇÈç¹û°ÑIronPythonµÄÔ´´úÂëÐÞ¸ÄÁ˺ó,Èç°ÑȱʡÊý×ÖÀàÐ͸ÄΪdecimal,ºÜ¶àCpythonµÄÄ£¿é¾Í²»ÄÜÓÃÁË.
ÕⶫÎ÷»¹Ã»³ÉÊ죬»¹ÔÚ·¢ÓýÖÐ
Èç¹ûÒªÓÃcpythonµÄ¶«Î÷£¬¾Íû¶à´óÒåÒå
ÎÒÓÐÏîÄ¿,ÒªÔÚ.NETÖÐÓÃ,ÓÃIPY¿ÉÒÔ¸ü½ôÃܼ¯³É
Ïà¹ØÎÊ´ð£º
ÒÑÖªPython ÖУº
s = unicode("²âÊÔ", "gb2312")
s = u'\u6d4b\u8bd5'
print s
²âÊÔ
ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô³ÉGb2312µÄºº×ÖÄØ£¿
ÕÒµ½¸ö·½·¨
......
pythonµÄPIL¿â×Ô´øµÄ·½·¨Ö»ÄܽøÐоØÐεÄÇиÈç¹ûÎÒÓÐÁËÒ»¸ö¶à±ßÐθ÷¸ö¶¥µãµÄ×ø±ê£¬ÈçºÎ¶ÔÏÖÓеÄͼƬ°´ÕÕÕâ¸ö¶à±ßÐνøÐÐÇиîÄØ£¿
²»Ò»¶¨ÒªÓÃPIL¿â£¬ÈκÎÄÜʵÏÖÕâ¸ö¹¦Äܵķ½·¨¶¼ÐС£
ͼƬÇиîµÄjs²»ÊǺܶàÂð£¿
......
±ÈÈçÎÒÐèÒªÓÃpython ¶Ôwin32³ÌÐò½øÐÐÒ»¶¨µÄ¿ØÖÆ
¶ÔtextboxÊäÈëÒ»´®×Ö·û´®
°´Ä³¸öbotton
¶ÔlistboxÀïµÄµÄÄÚÈݶÁÈ¡£¬´æ³É×Ö·û´®
¸ÃÈçºÎ²Ù×÷£¿
»òÕßÄÄÀïÓÐÎĵµÀý×Ó£¿
·Ç³£¸Ðл
......
ÎÒÓÃpython¿ª·¢ÁËÒ»×éGUI½çÃ棬ÁíÍâÒ»¸öͬ־ÓÃjavaʵÏÖÁËÓ¦ÓÃÖ÷¿ò¼Ü£¬ÏÖÔÚÒª½«ÕâЩGUI½çÃ漯³Éµ½Ö÷¿ò¼ÜÀïÃæÈ¥¡£²»ÖªµÀÔÚjavaÀïÃæ¸ÃÈçºÎµ÷Ó㿼ò¶øÑÔÖ®£¬¾ÍÊÇjava´úÂëÀïÃæÈçºÎµ÷ÓÃÒ»¸öÍⲿµÄ.pyÎļþ¡£Çë¸ø³öÒ»¸ö¼òµ¥µ ......
´íÎó´úÂëÈçÏ£º
<strong>exceptions.UnicodeEncodeError <br /> &#39;ascii&#39; codec can&#39;t encode characters in position 0-5: ordinal not in range(128)& ......