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

python pyc

 Ê²Ã´ÊÇpycÎļþ
pycÊÇÒ»ÖÖ¶þ½øÖÆÎļþ£¬ÊÇÓÉpyÎļþ¾­¹ý±àÒëºó£¬Éú³ÉµÄÎļþ£¬ÊÇÒ»ÖÖbyte code£¬pyÎļþ±ä³ÉpycÎļþºó£¬¼ÓÔصÄËÙ¶ÈÓÐËùÌá¸ß£¬¶øÇÒpycÊÇÒ»ÖÖ¿çƽ̨µÄ×Ö½ÚÂ룬ÊÇÓÉpythonµÄÐéÄâ»úÀ´Ö´Ðеģ¬Õâ¸öÊÇÀàËÆÓÚJAVA»òÕß.NETµÄÐéÄâ»úµÄ¸ÅÄî¡£pycµÄÄÚÈÝ£¬ÊǸúpythonµÄ°æ±¾Ïà¹ØµÄ£¬²»Í¬°æ±¾±àÒëºóµÄpycÎļþÊDz»Í¬µÄ£¬2.5±àÒëµÄpycÎļþ£¬2.4°æ±¾µÄpythonÊÇÎÞ·¨Ö´Ðеġ£
ΪʲôÐèÒªpycÎļþ
Õâ¸öÐèÇóÌ«Ã÷ÏÔÁË£¬ÒòΪpyÎļþÊÇ¿ÉÒÔÖ±½Ó¿´µ½Ô´ÂëµÄ£¬Èç¹ûÄãÊÇ¿ª·¢ÉÌÒµÈí¼þµÄ»°£¬²»¿ÉÄÜ°ÑÔ´ÂëҲй©³öÈ¥°É£¿ËùÒÔ¾ÍÐèÒª±àÒëΪpycºó£¬ÔÙ·¢²¼³öÈ¥¡£µ±È»£¬pycÎļþÒ²ÊÇ¿ÉÒÔ·´±àÒëµÄ£¬²»Í¬°æ±¾±àÒëºóµÄpycÎļþÊDz»Í¬µÄ£¬¸ù¾ÝpythonÔ´ÂëÖÐÌṩµÄopcode£¬¿ÉÒÔ¸ù¾ÝpycÎļþ·´±àÒë³öpyÎļþÔ´Â룬ÍøÉÏ¿ÉÒÔÕÒµ½Ò»¸ö·´±àÒëpython2.3°æ±¾µÄpycÎļþµÄ¹¤¾ß£¬²»¹ý¸Ã¹¤¾ß´Ópython2.4¿ªÊ¼¾ÍÒªÊÕ·ÑÁË£¬Èç¹ûÐèÒª·´±àÒë³öа汾µÄpycÎļþµÄ»°£¬¾ÍÐèÒª×Ô¼º¶¯ÊÖÁË£¨°³ÔÝʱ»¹Ã»ÕâÄÜÁ¦^--^£©,²»¹ýÄã¿ÉÒÔ×Ô¼ºÐÞ¸ÄpythonµÄÔ´´úÂëÖеÄopcodeÎļþ£¬ÖØбàÒëpython£¬´Ó¶ø·ÀÖ¹²»·¨·Ö×ÓµÄÆƽ⡣
Éú³Éµ¥¸öpycÎļþ
python¾ÍÊǸöºÃ¶«Î÷£¬ËüÌṩÁËÄÚÖõÄÀà¿âÀ´ÊµÏÖ°ÑpyÎļþ±àÒëΪpycÎļþ£¬Õâ¸öÄ£¿é¾ÍÊÇ py_compile Ä£¿é¡£
ʹÓ÷½·¨·Ç³£¼òµ¥£¬ÈçÏÂËùʾ£¬Ö±½ÓÔÚidleÖУ¬¾Í¿ÉÒÔ°ÑÒ»¸öpyÎļþ±àÒëΪpycÎļþÁË¡£(¼ÙÉèÔÚwindows»·¾³ÏÂ)
import py_compile
py_compile.compile(r'H:\game\test.py')
compileº¯ÊýÔ­ÐÍ£º
compile(file[, cfile[, dfile[, doraise]]])
file ±íʾÐèÒª±àÒëµÄpyÎļþµÄ·¾¶
cfile ±íʾ±àÒëºóµÄpycÎļþÃû³ÆºÍ·¾¶£¬Ä¬ÈÏΪֱ½ÓÔÚfileÎļþÃûºó¼Óc »òÕß o£¬o±íʾÓÅ»¯µÄ×Ö½ÚÂë
dfile Õâ¸ö²ÎÊýÓ¢ÎÄ¿´²»Ã÷°×£¬Çë¸÷λ´ó´ó´Í½Ì¡£(±ÉÊÓÏÂ×Ô¼º)Ô­ÎÄ£ºit is used as the name of the source file in error messages instead of file
doraise ¿ÉÒÔÊÇÁ½¸öÖµ£¬True»òÕßFalse£¬Èç¹ûΪTrue£¬Ôò»áÒý·¢Ò»¸öPyCompileError£¬·ñÔòÈç¹û±àÒëÎļþ³ö´í£¬Ôò»áÓÐÒ»¸ö´íÎó£¬Ä¬ÈÏÏÔʾÔÚsys.stderrÖУ¬¶ø²»»áÒý·¢Òì³£
(À´×Ôpython2.5Îĵµ)
ÅúÁ¿Éú³ÉpycÎļþ
Ò»°ãÀ´Ëµ£¬ÎÒÃǵŤ³Ì¶¼ÊÇÔÚÒ»¸öĿ¼Ïµģ¬Ò»°ã²»»á˵½ö½ö±àÒëÒ»¸öpyÎļþ¶øÒÑ£¬¶øÊÇÐèÒª°ÑÕû¸öÎļþ¼ÐϵÄpyÎļþ¶¼±àÒëΪpycÎļþ£¬pythonÓÖΪÁËÎÒÃÇÌṩÁËÁíÒ»¸öÄ£¿é£ºcompileall ¡£Ê¹Ó÷½·¨ÈçÏ£º
import compileall
compileall.compile_dir(r'H:\game')
ÕâÑù¾Í°ÑgameĿ¼£¬ÒÔ¼°Æä×ÓĿ¼ÏµÄpyÎļþ±àÒëΪpycÎļþÁË¡£ºÙºÙ£¬¹»·½±ã°É¡£À´¿


Ïà¹ØÎĵµ£º

PythonÖеĶÔÏó¡¢±äÁ¿¼°ÒýÓÃ

  ÔÚPythonÖУ¬ÎÒÃÇÖ´Ðбí´ïʽ a = 3£¬Python»áÔõÑù²Ù×÷ÄØ£¿
1¡¢Ê×ÏȻᴴ½¨Ò»¸ö¶ÔÏó±íʾֵ3
2¡¢Èç¹û±äÁ¿a²»´æÔÚ£¬´´½¨±äÁ¿a
3¡¢°Ñ±äÁ¿aÁ¬½Óµ½±íʾ3µÄ¶ÔÏó
ÔÚPythonÖУ¬±äÁ¿ºÍ¶ÔÏó´æ´¢ÔÚ²»Í¬µÄµØ·½£¬Í¨¹ýÖ¸ÕëÁ¬½ÓÆðÀ´...
Ò»¸ö±äÁ¿×ÜÊǺͶÔÏóÁ¬½ÓÆðÀ´£¬²»´æÔÚ²»ºÍ¶ÔÏóÁ¬½ÓµÄ±äÁ¿£¬µ«ÊÇ´óµÄ¶ÔÏó¿ÉÄÜÁ¬½Óµ½±ðµÄ¶ÔÏó¡£ ......

python 3.0Óëpython 2.xµÄÇø±ð

 ÕýÔÚÔĶÁ×îаæµÄ¡¶A byte of Python¡·¡£·¢ÏÖPython3.0ÔÚijЩµØ·½»¹ÊÇÓÐЩ¸Ä±äµÄ¡£×¼±¸ÂýÂýµÄÌå»á£¬ÓëÀÏ°æ±¾µÄ¡¶A byte of Python¡·×ö¶Ô±È£¬×îºóÔÙÈ¥²éÔĹٷ½ÍøÕ¾µÄÎĵµ¡£
1.
Èç¹ûÄãÏÂÔصÄÊÇ×îаæµÄPython£¬¾Í»á·¢ÏÖËùÓÐÊéÖеÄHello WorldÀý×Ó½«²»ÔÙÕýÈ·¡£
Old:
print "Hello World!" #´òÓ¡×Ö·û´®
New:
......

python rss½âÎöÓëÉú³É

 PyRSS2Gen £ºrssÉú³É 
ÏÂÔصØÖ·£ºhttp://www.dalkescientific.com/Python/PyRSS2Gen-1.0.0.tar.gz 
Àý×Ó£º
Java´úÂë 
import datetime  
import PyRSS2Gen  
  
rss = PyRSS2Gen.RSS2(  
   title = " ......

±»ÊèºöµÄÒ»¶ÎPythonÓï·¨

    pythonÌṩÁËÓÐÐò(sequence)ÀàÐÍ£¨×Ö·û´®£¬Ôª×飬ÁÐ±í¶¼ÊÇÓÐÐòÀàÐÍ£©£¬²¢ÇÒÌṩÁËÌØÊâµÄÓï·¨À´·½±ã¶ÔÕâЩÀàÐͽøÐвÙ×÷£¬×î³£ÓõÄÓÐÇÐƬ²Ù×÷¡£Í¬Ò»ÓÐÐòÀàÐ͵ĶÔÏóÖ®¼äÖ§³Ö¡±+¡±²Ù×÷·û£¬ÓÃÀ´Á¬³ÉÒ»¸öеÄÓÐÐò¶ÔÏó£¬ÓÐÐò¶ÔÏóÒ²¿ÉÒÔÓëÒ»¸öÕûÊý½øÐÐÏà³Ë£¬µÃµ½Ò»¸öеÄÓÐÐò¶ÔÏó¡£ÔÚµ÷ÊÔµÄʱºò£¬ÎÒ¾­³£Ê¹ÓÃÕâÑù ......

Python PAMIEʾÀý

 ×ª×Ô:http://blog.chinaunix.net/u3/103146/showart_2058891.html
PythonÕâÖֽű¾ÓïÑÔµÄÇ¿´ó¹¦ÄÜÔ½À´Ô½±»¹ã´óµÄ³ÌÐòÔ±ËùÖØÊÓ£¬ÕâÖÖ֮ǰÔÚ¹úÄÚÁ÷ÐжȲ»¸ßµÄÓïÑÔ½üÀ´ÆøÊƸßÕÇ¡£¸÷ÖÖµÚÈý·½Ä£¿é²ã³ö²»Çî¡£
 
±¾ÎĽéÉܵıãÊÇÒ»ÖÖÄܷdz£·½±ã²Ù×÷IEµÄµÚÈý·½¹¤¾ß£¬PAMIE£¬ËûÄÜÈÃÄãÈçͬдJSÒ»ÑùÀ´²Ù×÷IEä¯ÀÀÆ÷¡£°üÀ¨×Ô ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ