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

Python£¬¼òµ¥µÄÁ¦Á¿

Python£¬¼òµ¥µÄÁ¦Á¿
¶¹°êÍø¶Ô»¥ÁªÍøÓû§À´ËµÊÇÖªÃûµÄWeb 2.0ÉçÇø£¬µ«¶Ô¿ª·¢Õ߶øÑÔ£¬¸üÖØÒªµÄÊÇÒ»¸öÓ¦ÓÃPython´òÔìµÄ·Ç³£³É¹¦µÄWeb 2.0Õ¾µã¡£
Pythonµ®ÉúÒÑÓÐ20ÄêµÄÀúÊ·£¬Ä¿Ç°¹úÄÚµÄPython·¢Õ¹×´¿öÈçºÎ£¿ÓëÆäËûÓïÑÔ£¨Æ½Ì¨£©Ïà±È£¬PythonÓÐÄÄЩÏÔ¶øÒ×¼ûµÄÓŵ㣿¶¹°êÓ¦ÓÃPython½øÐÐWeb¿ª·¢ÓÐÄÄЩ³É¹¦¾­Ñé¿ÉÒÔ½è¼ø£¿´ø×ÅÕâЩÎÊÌ⣬51CTO¼ÇÕßÔÚQcon 2010»á³¡ÓÐÐҲɷõ½¶¹°êÍøÊ×ϯ¼Ü¹¹Ê¦ºéÇ¿ÄþÏÈÉú£¬ÓÉËûÀ´ÏòÎÒÃǽ²½âPythonµÄWeb¿ª·¢Ö®µÀ¡£
PythonÕýÔÚ³ÉΪһÃÅÖ÷Á÷ÓïÑÔ
PythonÔÚ¹úÄÚµÄÐËÆðÒѾ­ÓнüÎåÄêµÄʱ¼ä£¬ÔÚ2004Äêµ×¶¹°ê¸Õ¸Õ¿ªÊ¼Æð²½µÄʱºò£¬¹úÄÚPythonÓû§ÒѾ­³õ²½ÐγÉÒ»¸öСȦ×Ó£¬¼¯ÖÐÔÚCPUGÉçÇø£¨CPUGÊÇÖйúµÚÒ»¸öÕýʽ³ÉÁ¢µÄPythonÉçÇø£¬¾Û¼¯ÁË´óÁ¿Python°®ºÃÕߣ¬ÎªPythonµÄÆÕ¼°ºÍÍƹãÆðµ½ÖØÒª×÷Óã©£»ÏÖÔÚ£¬GPUGµÄÀÏÓû§É¢²¼ÔÚ¹úÄÚ¸÷´óÈí¼þ¹«Ë¾£¬ÔÚËûÃǵÄÍƶ¯Ï£¬ÏÖÔÚ¹úÄڷdz£¶àµÄÈí¼þ¹«Ë¾ÔÚʹÓÃPython¡£
³ýÁËÉçÇøµÄÍƶ¯£¬°ñÑùµÄÁ¦Á¿Ò²ºÜÖØÒª¡£Ëæ×Ŷ¹°êµÄ³É¹¦£¬Á˽âPython¡¢Ñ§Ï°ºÍÓ¦ÓÃPythonµÄÈËÒ²Ô½À´Ô½¶à£¬ËüÒѾ­²»ÔÙÊǼ¸ÄêÇ°µÄÒ»ÃÅСÖÚÓïÑÔ¡£ºéÇ¿Äþ˵£º“PythonÔÚ¹úÄÚµÄʹÓÃÒѾ­ÏñÇ°¼¸ÄêÔÚ¹úÍâµÄ·¢Õ¹Ò»Ñù£¬Öð½¥³ÉΪһÃÅÖ÷Á÷µÄÓïÑÔ”¡£
Python¼òµ¥µÄÁ¦Á¿
½üÄ꣬PythonµÄÓ¦Ó÷¶Î§Ô½À´Ô½¹ã£¬Ò²ÎüÒýÁË.NETºÍJavaƽ̨µÄ×¢Ò⣬±ÈÈç.NETƽ̨ÉϵÄIronPythonºÍJVMÉϵÄJython¡£PythonµÄÄÄЩÌØÐÔÎüÒýÁËÕâЩƽ̨¶ÔËüµÄÒýÈ룿
“ÒòΪPythonµÄ¼òµ¥£¬Ëü±ÈJava¼òµ¥£¬±ÈC#¼òµ¥”£¬ºéÇ¿Äþ˵µÀ£ºÎÞÂÛÔÚJVMƽ̨»¹ÊÇ.NETƽ̨£¬ÓÃJythonºÍIronPythonÀ´×ö¿ª·¢£¬´Ó¿ª·¢Ð§ÂÊÉϽ²£¬PythonµÄ¿ª·¢ÉÏÊÇÒª±ÈÖ±½ÓʹÓÃJavaºÍC#µÄ¿ª·¢Ð§Âʸߡ£
ÔÚ.NET»òJavaƽ̨£¬ÓïÑÔÉϵÄÑ¡Ôñ¸ü¶àµÄÊÇ´ÓÐÔÄܽǶÈÀ´¿¼ÂÇ£¬JavaºÍC#ÔÚÐÔÄÜÉϵÄÓÅÊÆPython¿ÉÄÜÎÞ·¨×·¸Ï£¬µ«´ÓʵÏÖÒµÎñÂß¼­ºÍ¹¦ÄܵĽǶȿ´£¬JavaºÍC#¿ÉÒÔ×öµÄ£¬PythonÒ²¿ÉÒÔ×ö£¬¶øÇÒ¸ü¼Ó¼òµ¥¡£
Python vs Ruby
PythonÊÇÒ»ÃŶ¯Ì¬ÓïÑÔ£¬ÔÚ¿ª·¢Ð§ÂÊÉÏÓÐ×ÅÏÈÌìµÄÓÅÊÆ£»µ«ÎÒÃÇÒ²»áÏëµ½½üÄê´óÈȵÄRubyÓïÑÔ£¬Í¬Ñù¾ßÓж¯Ì¬ÌØÐÔ£¬Í¬Ñù³¤ÓÚÃô½Ý£¬ËüÃÇÁ½ÕßÖ®¼äÓÐÄÄЩ²î±ðÄØ£¿
ºéÇ¿ÄþÖ¸³ö£¬¶¹°êÔÚ¸Õ¿ªÊ¼¼¼ÊõÑ¡ÐÍʱ¿¼ÂǹýRuby£¬µ«ÔÚµ±Ê±¿´À´£¬PythonµÄ¿âÒª±ÈRuby¸ü³ÉÊ죻RubyÇ¿ÓÚRails¿ò¼ÜµÄÓ¦Ó㬵«Éæ¼°µ½ºǫ́¼ÆËã·½ÃæµÄÄÜÁ¦£¬PythonµÄÓÅÊƸü¼ÓÃ÷ÏÔ¡£PythonºÍRubyÁ½ÖÖÓïÑÔ±¾ÉíûÓкûµÖ®·Ö£¬Á½ÖÖÓïÑÔ¶¼Óзdz£³É¹¦µÄ°¸Àý£¬¶¼ÄÜ×ö³öºÃµÄWebÓ¦Ó㬸ü¶àµÄÑ¡Ôñ»¹ÊÇ¿ª·¢ÕߵĸöÈËϲºÃÎÊÌâ¡£
¶¹°êPythonÓ¦Óÿª·¢¾­Ñé̸
¶¹°ê


Ïà¹ØÎĵµ£º

Python Ï̳߳صÄʵÏÖ

import urllib2
import time
import socket
from datetime import datetime
from thread_pool import *

def main():
url_list = {"sina":"http://www.sina.com.cn",
"sohu":"http://www.sohu.com",
"yahoo":"http://www.yahoo.com",
"xiaonei":"http://www.x ......

·ÉÐÅÆóÒµ°æʹÓÃÁËpython...

¶ÔÓÚ¸öÈ˰棬ʹÓÃÁË.NET£¬°²×°ÍêÆóÒµ°æºó£¬¿´ÁË¿´Ä¿Â¼£¬·¢ÏÖ´óÁ¿python½Å±¾¡£dllÖÐÒ²ÓÐsqlite3.dll
C:\Program Files\China Mobile\EfetionĿ¼ÏÂÎļþ£º
Addin
boost_python.dll
bz2.pyd
dbghelp.dll
EFetion.exe
EFetion.exe.manifest
EFWP.exe
EFXLiveUpdate.exe
EFXLiveUpdate.exe.manifest
Face
Help.chm
......

python¸Ä±äÎļþ¼°Æä×ÓĿ¼µÄÊôÐÔ


1.¸Ä±ä±¾ÎļþµÄÊôÐÔ
import
os
import
stat
os.chmod( filename, stat.S_IWRITE )
2.¸Ä±ä±¾Ä¿Â¼¼°Æä×ÓĿ¼ÊôÐÔ
import
os
os.system(r
'
attrib -r' + path +'\\*.* /s
'
)
3.½éÉܸıäÎļþÊôÐÔµÄdosÖ¸Áî
Attrib
ÏÔʾ¡¢ÉèÖûòɾ³ýÖ¸ÅɸøÎļþ»òĿ¼µÄÖ»¶Á¡¢´æµµ¡¢ÏµÍ³ÒÔ¼°Òþ²ØÊôÐÔ¡£Èç¹ûÔÚ²»º¬²ÎÊýµÄÇ ......

ʹÓÃpython»ñÈ¡htmlÒ³ÃæµÄÄÚÈÝ

import urllib
from HTMLParser import HTMLParser
class TitleParser(HTMLParser):
def __init__(self):
self.title = ''
self.divcontent = ''
self.readingtitle = 0
self.readingdiv = 0
HTMLParser.__init__(self)
def handle_starttag(self, tag, attrs): ......

Eclipse Python¿ª·¢»·¾³

1£¬ÏÂÔØorg.python.pydev.feature-1.5.0.1251989166.zip http://sourceforge.net/projects/pydev/files/
2£¬°²×°²å¼þµ½eclipse
3£¬ÖØÆôeclipse
×¢Ò⣺ʹÓÃ1.5.6°æ±¾pydev²å¼þ£¬´´½¨python¹¤³Ì»á±¨´í£¬Ê¹ÓÃ1.5.0°æ±¾ÎÞ´ËÎÊÌâ¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ