PythonÈëÃÅ
Ò»¡¢Ê²Ã´ÊÇPython£¿
¶ÔÓÚÕâÖÖÎÊÌâÎÒÃÇÀ´°Ù¶ÈһϾͿÉÒÔÁË¡£
“PythonÊÇÒ»ÖÖ¿ª·ÅÔ´´úÂëµÄ½Å±¾±à³ÌÓïÑÔ£¬ÕâÖֽű¾ÓïÑÔÌرðÇ¿µ÷¿ª·¢ËٶȺʹúÂëµÄÇåÎú³Ì¶È¡£Ëü¿ÉÒÔÓÃÀ´¿ª·¢¸÷ÖÖ³ÌÐò£¬´Ó¼òµ¥µÄ½Å±¾ÈÎÎñµ½¸´Ôӵġ¢ÃæÏò¶ÔÏóµÄÓ¦ÓóÌÐò¶¼ÓдóÏÔÉíÊֵĵط½¡£Python»¹±»µ±×÷Ò»ÖÖÈëÃųÌÐòÔ±×îÊʺÏÕÆÎÕµÄÓÅÐãÓïÑÔ£¬ÒòΪËüÃâ·Ñ¡¢ÃæÏò¶ÔÏó¡¢À©Õ¹ÐÔǿͬʱִÐÐÑϸñµÄ±àÂë±ê×¼¡£ ”
¶þ¡¢ÎªÊ²Ã´ÒªÑ¡ÔñPython£¿
»»¾ä»°À´Ëµ¾ÍÊÇPythonµÄÓÅÊÆÔÚÄÄÀ±¾È˺ÜÀÁ£¬ÕâÖÖÎÊÌâÒ²°Ù¶ÈһϾͿÉÒÔÁË£¬¹Ø¼ü´Ê£ºPythonÓÅÊÆ£¬¿ÉÒÔÕÒµ½ÒÔÏÂÃèÊö£º
“1.Óï·¨¼òµ¥£¬×ÔÈ»£¬Ñ§Ï°ÇúÏߵ͡£
2.¿ª·¢»·¾³¼òµ¥£¬²»ÐèÒª¸´ÔÓµÄide¼´¿ÉÍê³É¿ª·¢£¬¶Ô¿ª·¢»úµÄÒªÇóÒ²ºÜµÍ¡£
3.¿ª·¢¹ý³Ì¼òµ¥£¬²»ÐèÒª±àÒ룬Ҳ²»ÐèÒªc/javaµÈµÄ¸´ÔÓÅäÖá£
4.ÔËÐÐËٶȿ죬ÖÁÉÙ±Èjava¿ìºÜ¶à¡£½«À´»¹¿ÉÒÔʹÓÃpypyÀ´¼ÓËÙ£¬ÄÜ´ïµ½C/C++µÄ¼¶±ð¡£
5.ÊÊÓ÷¶Î§¹ã£¬¿ÉÒÔ¿ª·¢´ÓÆóÒµ¼¶Ó¦Óã¬×ÀÃæÓ¦Ó㬵½Ç¶Èëʽ¶¼¿ÉÒÔ¡£
6.ÊÊÓÚÍŶӿª·¢£¬·½±ãµÄµ¥Ôª²âÊÔºÍÈÝÒ×ͳһ³ÌÐò·ç¸ñ¡£”
Èç¹û¶ÔÉÏÊöÃèÊö¸ÐÐËȤµÄ»°Äú¾ÍÓпÉÄÜÑ¡ÔñPython¡£
Èý¡¢PythonÆðÔ´
»¹ÊÇ°Ù¶Èһϣ¬¹Ø¼ü´Ê£ºPythonÆðÔ´
“PythonµÄ´´Ê¼ÈËΪGuido van Rossum¡£1989ÄêÊ¥µ®½ÚÆڼ䣬ÔÚ°¢Ä·Ë¹Ìص¤£¬GuidoΪÁË´ò·¢Ê¥µ®½ÚµÄÎÞȤ£¬¾öÐÄ¿ª·¢Ò»¸öеĽű¾½âÊͳÌÐò£¬×öΪABCÓïÑÔµÄÒ»Öּ̳С£Ö®ËùÒÔÑ¡ÖÐPython£¨´óòþÉßµÄÒâ˼£©×÷Ϊ³ÌÐòµÄÃû×Ö£¬ÊÇÒòΪËûÊÇÒ»¸öMonty ´óòþÉß·ÉÐÐÂíÏ·Íŵİ®ºÃÕß”
ËÄ¡¢Python¹ÙÍø
ºÃÁ˱ØÒªµÄÂÞà½áÊøÁË£¬ÎÒÃǸÃÑÔ¹éÕý´«ÁË£¬ÏÈÖªµÀ¹ÙÍøÔÚÄÄÀΪɶ£¿µ±È»ÊÇÈ¥ÏÂÔØPythonÀ²£¬Òª²»ÓÃɶÀ´Ñ§Ï°°¡¡£
¹ÙÍøÍøÖ·£ºhttp://www.python.org/
Îå¡¢ÏÂÔØPython
ºÇºÇ£¬ÉÏÃæÒ»Ìõ¹À¼Æ¶ÔÄúÏÂÔØPythonûÓÐÌ«´ó°ïÖú£¬ÒòΪ¹ÙÍøÏÂÔØÒ³Ãæ¾³£´ò²»¿ª£¬¾Ý˵ÊDZ»·âÁË£¬µ«ºÃ´¦ÊÇÍøÂçÕâô´ó£¬ÕÒ¸öÏÂÔصĵط½ºÜÈÝÒ×£¬°Ù¶Èһϣ¬¹Ø¼ü´Ê£ºpython-3.1.1£¬ÎÒÃǾÍÓÃÕâ¸ö°æ±¾µÄÀ´Ñ§Ï°¡£
Áù¡¢°²×°Python
ÏÂÔØÏÂÀ´µÄÎļþÃûΪpython-3.1.1.msi
Ïà¹ØÎĵµ£º
PythonÖÐ×Ö·û´®±»¶¨ÒåΪÒýºÅÖ®¼äµÄ×Ö·û¼¯ºÏ¡£PythonÖ§³ÖʹÓóɶԵĵ¥ÒýºÅ»òË«ÒýºÅ£¬ÈýÒýºÅ°üº¬µÄ×Ö·û´®¡£
ʹÓÃË÷Òý²Ù×÷·û([])ºÍÇÐƬ²Ù×÷·û([:])¿ÉÒԵõ½×Ó×Ö·û´®¡£×Ö·û´®ÓÐÆäÌØÓеÄË÷Òý¹æÔò£ºµÚÒ»¸ö×Ö·ûµÄË÷ÒýÊÇ£°
£¬×îºóÒ»¸ö×Ö·ûµÄË÷ÒýÊÇ-1¡£
¼ÓºÅ(+)ÓÃÓÚ×Ö·û´®Á¬½ÓÔËË㣬ÐǺÅ(*)ÔòÓÃÓÚ×Ö·û´®Öظ´¡£ÈçÏÂÀý£º
pystr = " ......
ÄÜÕûÀí´ó²¿·ÖÎÞÓÃÎļþ
#!/usr/bin/python
#syscleaner.py
import os
import os.path
#delete files and directory recursively
def itedel(dir):
print('in dir :'+dir)
for doc in os.listdir(dir):
try:
if(os.path.isdir(doc)):
itedel(dir+'\\'+doc)
......
֮ǰдÁËÒ»¸ö×Ô¶¯½âѹѹËõÎļþµ½Ñ¹ËõÎļþËùÔÚÎļþ¼ÐµÄ½Å±¾
ºó¸ù¾Ý×Ô¼ºÐèÒª£¬Ð´ÁËÁíÍâÁ½¸ö¡£ÔÀíÒ»Ñù
¶¼ÊÇʹÓÃwinrarµÄÃüÁî
µÚÒ»¸ö½Å±¾Ã»¿¼ÂÇÖܵ½£¬Ö»ÄܽâѹrarÎļþ
¸Ä½øºó¿ÉÒÔÖ§³ÖwinrarÖ§³ÖµÄ¸÷ÖÖÎļþ
°ÑÖ¸¶¨Îļþ¼ÐϵÄÎļþ±£´æµ½Ö¸¶¨Îļþ¼Ð
#rardir.py
import os
import sys
src=sys.argv[1]
dst=sys.argv[2]
......
ת×Ô http://www.javaeye.com/topic/66558
³õѧPython,Óöµ½ºÜ¶à±àÂëÎÊÌ⣬¼ÇÏÂÀ´ÒÔÃ⽫À´ÓÖÍüÁË£¬ºÜ¶à¶«Î÷²»¶®£¬¶¼ÊÇÊôÓÚ²»ÇóÉõ½â£¬ÂÒϽáÂÛ£¬µ«Ïëµ½ÄóöÀ´¿ÉÒÔÓÐÈÈÐÄͬѧָ³ö´íÎóËùÔÚ£¬±ãºñÆðÁ³Æ¤ÁË……
Ê×ÏÈÐèÒªÁ˽âPythonÖÐÓÐÁ½ÖÖ×Ö·û´®(ÑϸñµØ˵,Ëƺõ²»ÄÜÕâô½Ð)¡£Ò»ÖÖÊÇÆÕͨµÄstr¶ÔÏó£¨Ã¿¸ö×Ö·ûÓÃ8bits± ......
int main()
{
int a[] = {1,2,3,4,5};
int i;
int * p = a;
for (p = a + 4, i = 0; i < 5; i++) {
printf("%d ",p[-i]);
}
return 0;
}
......