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

»ù±¾Êý¾Ý½á¹¹µÄpythonʵÏÖ ¶ÑÕ»

Ç°ÑÔ£º
×î½üÓÖÏëѧϰpython,ÓÖÏëÈ¥ÎÂÏ°Ò»ÏÂËã·¨£¬ÓÚÊǾÍÏë³öÁËÕâ¸öÁ½²»ÎóµÄ·½·¨,^_^
¶ÑÕ»£º
ʹÓÃpythonµÄÁбí½á¹¹£¬ÏêÇé¿ÉÒԲ鿴help(list)
#Filename: stack.py
shoplist=['apple','mango','carrot','banana']
shoplist.append('rice')
popitem=shoplist[-1]
del shoplist[-1]
print 'the popitem is',popitem
print 'My shopping list is now',shoplist
print 'the next pop item is',shoplist[-1]
print 'after the next pop,the shopping list is',shoplist[:-1]


Ïà¹ØÎĵµ£º

Python¸ÅÊö

    Python ÊÇÃâ·ÑµÄ½âÊÍÐÔÓïÑÔ£¬¾ßÓÐÃæÏò¶ÔÏóµÄÌØÐÔ¡£¿ÉÒÔÔËÐÐÔÚ¶àÖÖ²Ù×÷ϵͳ֮ÉÏ£¬Python¾ßÓÐÇåÎúµÄ½á¹¹£¬¼ò½àµÄÓï·¨ÒÔ¼°Ç¿´óµÄ¹¦ÄÜ¡£Python¿ÉÒÔÍê³É´ÓÎı¾´¦Àíµ½ÍøÂçͨÐŵȸ÷ÖÖ¹¤×÷£¬python×ÔÉíÒѾ­ÌṩÁË´óÁ¿µÄÄ£¿éÀ´ÊµÏÖ¸÷ÖÖ¹¦ÄÜ£¬³ý´ËÒÔÍ⻹¿ÉÒÔʹÓÃC/C++À´À©Õ¹Python£¬ÉõÖÁ»¹¿ÉÒÔ½«PythonǶÈëµ½ÆäËûÓ ......

Python ÖеÄ×Ö·û±àÂë

1¡¢strÀàÐÍ¿ÉÒÔÀí½âΪһ¸ö¶þ½øÖÆblock£¬»òmultibyte
2¡¢multibyte_str.decode("<multibyte_encode_method>")  -> unicode
3¡¢unicode_str.encode("<multibyte_encode_method>")  -> multibyte_str(binary block)
4¡¢unicode_str µÄ²Ù×÷²ÎÊýҲӦΪunicode£¬È磺unicode_str.find("Ñù±¾".deco ......

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

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

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

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

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

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°æ±¾ÎÞ´ËÎÊÌâ¡£ ......

Python Socket±à³Ì

1£¬±àдServer.py
import socket
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind(('localhost',8081))
while True:
    data,addr=s.recvfrom(1024)
    print 'receive:',data,'from',addr
2£¬±àдClient.py
import socket
s=socket.socket(socket.AF_INET,socket.SOC ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ