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

pythonÖеÄexec º¯Êý

      ÔÚÏîÄ¿ÀïÃæÒ»¸ö½âÎöÎı¾µÄ¹¤¾ßÀïÃæÓõ½ÁËÕâ¸öÃüÁîÀ´¸³Öµ£¬¿ªÊ¼Ò»Ö±ÖªµÀÒâ˼£¬ºÇºÇ ²éÁËÏ£¬ÕÒµ½·½·¨ÈçÏ£º
exec
Óï¾äÓÃÀ´Ö´Ðд¢´æÔÚ×Ö·û´®»òÎļþÖеÄPythonÓï¾ä¡£ÀýÈ磬ÎÒÃÇ¿ÉÒÔÔÚÔËÐÐʱÉú³ÉÒ»¸ö°üº¬Python´úÂëµÄ×Ö·û´®£¬È»ºóʹÓÃ
exec
Óï¾äÖ´ÐÐÕâЩÓï¾ä¡£ÏÂÃæÊÇÒ»¸ö¼òµ¥µÄÀý×Ó¡£
>>> exec 'print "Hello World"'
Hello World
t ='ggg'
exec('relist.append(%s)' % 't')
 relist = ['ggg'] 


Ïà¹ØÎĵµ£º

ÓÃpythonµÄcmdÄ£¿éдһ¸ö¼òµ¥µÄshell

 from cmd import *
class MyShell(Cmd):
    def preloop(self):
        print "print this line before entering the loop"
            
    def postloop(self):
&nb ......

ɾ³ý¹¤³ÌÖÐsvnÎļþµÄ½Å±¾(Ruby°æºÍPython°æ)

Á½ÖÖ²»Í¬µÄÓïÑÔ,²»Í¬µÄ±í´ï!
Python½Å±¾ÊµÏÖ.
""
"
    File Name : clean.py
    File Date : 2009/11/5 14:22:56
    Author     : DannyLai
    Purpose     : Cle ......

Python , Delphi , Loki ÓÐȤµÄÀ´Ô´

 Python , Delphi , Loki Èý¸öµ¥´ÊÓÐȤµÄÀ´Ô´
Ðí¶à³ÌÐòÉè¼ÆÓïÑԺͿª·¢¹¤¾ßÒÔ¼°¿âµÄÃû×Ö¶¼À´Ô´ÓëÉñ»°£¬ÆÄÓÐÒâ˼£º
     °¢²¨ÂÞÊÇͬʱ³öÏÖÔÚÏ£À°ºÍÂÞÂíÉñ»°ÖеİÂÁÖÅÁ˹ʮ¶þ´óÉñÖ®Ò»¡£Ëû³ýÁËÓµÓÐÌ«ÑôÉñµÄÉí·Ö£¬Í¬Ê±»¹ÓÐÔ¤ÑÔ¡¢ÒÕÊõ¡¢Ò½ÊõÖ®ÉñµÄ³ÆºÅ¡£°¢²¨ÂÞÊÇÖæ˹ºÍÀÖ¶äµÄ¶ù×Ó£¬ºÍ°¢µÙÃÛ˹ÊÇË ......

Python¿ª·¢Activex×é¼þ

PythonÇ¿µÄ¹¦ÄܾÍÔÚÓÚËüÎÞËù²»ÄÜ¡£
ʹÓÃwin32comÄ£¿é¿ª·¢window ActiveXµÄʾÀý£º£¨Èç¹ûÄ㻹ûÓÐ×°win32comÄ£¿éµÄ»°£¬Çëµ½http://python.net/crew/skippy/win32/Downloads.htmlÏÂÔØ£©¡£
# SimpleCOMServer.py
class PythonUtilities:
_public_methods_ = ['SplitString']
_reg_progid_ = "Python.Utilities"
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ