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

¡¶Dive Into Python¡··ÇËÀ²»¿É

ÒëÕßÑÔ£º
ÔçÔÚ 2008 Äê 8 Ô£¬ÎÒ¾ÍÔøÔÚ×Ô¼ºµÄ²©¿Í·¢±íÁËһƪ¡¶ÎªÊ²Ã´<Dive into Python>²»ÖµµÃÍÆ¼ö¡·£¨http://blog.csdn.net/lanphaday/archive/2008/08/28/2845258.aspx
£©£¬µ±Ê±ÒýÆðµÄÌÖÂ۾Ͳ»¶à˵ÁË£¬²»¹ýÊÂʵÉϵ½½ñÌìÈÔÈ»ÓÐÐí¶àÅóÓÑÁôÑÔÓëÎÒÌÖÂÛ£¬ÈÃÎÒ¼¸´ÎÔôÐIJ»ËÀ£¬ÏëдÔÙÉîÈëÅúÅС£ºÃÔ˵ÄʱºòÔÚÎÒÕæÕýÔÜ×㶯Á¦Ö®Ç°£¬¿´µ½ÁËÕâÆª¡¶Dive Into Python Must Die¡·£¬ÂîµÃÍ´¿ì£¡ËùÒÔÎҾͰÑËü¼òµ¥·­Òëһϣ¬½è»¨Ï×·ð£¬Ò²ËãÊÇ×÷Ϊ´ó¼Ò¶ÔÎÒ֮ǰµÄСÎĵÄÒ»¸ö»ØÓ¦¡£
===================
Ô­ÎÄ£ºhttp://oppugn.us/posts/1272050135.html
Ò룺ÀµÓºƣ¨http://laiyonghao.com
£©
By Zed A. Shaw
¡¶Dive Into Python¡··ÇËÀ²»¿É
ÎÒÊܹ»ÁË¡£
¡¶Dive Into Python¡·
ÊÇÒ»±¾¹ØÓÚѧϰ
Python µÄÀÃÊ飬Ëü·ÇËÀ²»¿É¡£
Ðí¶àÈËÕÒµ½Õâ±¾Ê飬²¢±»Ëü¼«ÆäÀ¬»øµÄÕ½ÚÉè¼ÆÅª
ËÀÔÚѧϰ֮·ÉÏ£¬Îª´ËÎÒ¾ö¶¨ÐûÕ½ÁË¡£
¸ÃÊé²»¿É˼Ò飬ʹÓùýʱµÄ¼¼Êõ£¬¾ÙÃæÄ¿¿ÉÔ÷µÄÀý
×Ó£¬²¢ÇÒ Mark Pilgrim£¨×÷Õߣ©Ãæ¶ÔËûÈËÆÀÂÛʱÀä³°ÈÈ·í£º
09:42 @
diveintomark @ zedshaw ÍêÈ«ÖØÐ´ÁËÒ»±¾ÎÒ 6 Äêû´òÀí¹ýµÄÊéµÄǰ3Õ£¿
Êǵģ¬ÎÒ¼´¿ÌÈ¥°ì¡£
11:32
@ diveintomark @ zedshaw Äã¿Ï¶¨ÊÇÓкܶàÒâ¼û¡£
Äã×îºÃÔÚ²©¿ÍÉÏд£¡
ÕâÊÇËû¶ÔÎÒÌá³ö´ÓÊéÖÐ°Ñ ODBC Ïà¹ØÕ½Úɾ³ýµÄ´ð¸´¡£
ÏÖÔÚÒѾ­ 2010
ÄêÁË£¬ËûÄDZ¾ºÅ³ÆÄܹ»½Ì»á´ó¼Ò±à³ÌµÄ¸ÃËÀµÄÊ飬ÈÔȻʹÓÃÉÏÊÀ¼Í 90 Äê´úµÄ¼¼Êõ¡£
Êǵģ¬ÊÂʵÉÏ
Ëû
ÊÇÔÚ 6 Äêǰ½Ìѧ Python ʱ¿ªÊ¼
дËûµÄÊéµÄ¡£
µ«¼´Ê¹µ±Ê±ÕâÒ²ÊÇÒ»¸öÓÞ´À
µÄ¾ö¶¨¡£
ÕâÔڿƼ¼ÊéÀúÊ·ÉÏÎÅËùδÎÅ¡£
Mark Lutz µÄÊé¡¶Learing
Python¡·ÒѸüР4 ´Î£¬ÄÚÈÝÓëÕâÃűà³ÌÓïÑÔÑϸñÒ»Ö¡£
ËûµÄÊéºÜÈÝÒ×ÔĶÁ£¬ºÜÈÝÒ×
½Ì»á´ó¼Ò£¬¶ÁÕß²¢²»ÐèÒªÓжàÉÙÓйؼÆËã»úµÄ֪ʶ¡£
Óë´Ëͬʱ£¬Pilgrim ÏÈÉúµÄÊéÒѾ­ 6
ÄêûÓиüУ¬ËäÈ»ËüÊÇÔÚÏßÊé¼®£¬¶ÁÕßÄܹ»¸ø×÷ÕßÌá½»²¹¶¡¡£
û´í£¬Õâ¼Ò»ïµÄÊéÊǰÚÔÚÁËÍøÂçÉÏ£¬¿ÉÊǼ´Ê¹´ó¼Ò
¶¼¸øËûÌáÁËÒâ¼ûºÍ·´À¡£¬ËûÈÔÈ»ÀÁµÃ¸üС£
Èç¹ûËû°ÑÊéµÄÔ´ÂëÄóöÀ´£¬ÄÇô´ó¼ÒÒ²¿ÉÒÔΪËû¾À
ÕýÕâЩ´í©£¬µ«ËûûÓС£Ëû°Ñ×Ô¼ºµÄÄÇíÈʺ·Åµ½ÍøÉÏÃâ·ÑÔĶÁ£¬ÒÔ´Ë×÷ΪÓë¡¶Learing Python¡·¾ºÕùµÄΨһÊֶΡ£
¡¶Dive
Into Python¡·²¢·Ç½ö½öÒòΪʹÓÃÁË ODBC ¶ø±»ÆÀΪÀÃÊ飬¼´Ê¹µÚÒ»¸öÀý×ÓÒ²Àõ½Èçͬ¹·Êº¡£
¿´¿´ÄãµÄµÚÒ»¸ö Python ³ÌÐò
£¬ÓжàÉÙ¶«Î÷ÐèÒª³õѧÕßÄܹ»憣È»ÁìÎò£º
´ø×ÅÒ»íȾ޴óµÄÎĵµ×Ö·û´®
È¥¶¨Ò庯Êý¡£
ÃæÄ¿¿ÉÔ÷µÄ˫ϻ®Ïß±äÁ¿£¬»¹Ê¹


Ïà¹ØÎĵµ£º

ÈçºÎÔËÐÐPython½Å±¾

¼ÙÉèÄãÄãµÄ²Ù×÷ϵͳÊÇWinXP£º

¿ªÊ¼²Ëµ¥-> ÔËÐÐ-> cmd

È»ºó¾Í¿ÉÒÔÇÃÃüÁîÁË¡£

Èç¹ûÄãÓÃIDLE£¬¿ÉÒÔÓÃIDLE´ò¿ªÕâ¸ö.pyÎļþ£¬È»ºóÔڲ˵¥ "Run "ÏÂÓÐÒ»Ïî "Run   Module "£¬µã»÷¼´¿É¡£ ......

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£¨Èý£©Íò¶ñµÄ±àÂë

Íò¶ñµÄ±àÂë
С²Ë¶ÔÓÚÀÏʦÉÏÒ»½Ú½²µÄ²»ÊǺÜÃ÷°×£¬ÒòΪûÓÐÒ»±¾ÊéÊǽ«ÎļþÓëwebÒ»Æð½²Êڵģ¬Ëû¾ö¶¨×Ô¼ºÌ½¾¿Ò»ÏÂËüÃÇÖ®¼äµÄ²»Í¬£º
Ê×ÏÈ£¬Ð¡²ËÔÚCÅ̽¨ÁËÒ»¸öÎı¾Îĵµ file.txt,ÊäÈëËĸö×Ö£ºÎÒÊÇС²Ë¡£
È»ºó£¬Ð¡²ËÔÚshellÖÐÁ·Ï°ÆðÀ´£º
>>> file=open("c:\\file.txt","r")
>>> data=file.read()
>> ......

»ù±¾Êý¾Ý½á¹¹µÄpythonʵÏÖ ¶ÓÁÐ

¶ÓÁУº
Óë¶ÑÕ»ÀàËÆ£¬Í¨¹ýpythonµÄÁбíÀàÐÍÀ´ÊµÏÖ£¬²Î¿¼ help(list)
shoplist=['apple','mango','carrot','banana']
print 'I have',len(shoplist),'items to purchase'
print 'these items are:'
for item in shoplist:
print item,
shoplist.append('rice')
print 'my shopping list is now', shoplist
shoplist. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ