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

python list for Ñ­»·ÎÊÌâ

Python code:

p=[1,2,3,4,5,6]
while True:
for i in p:
if i==4:
p=[]
f=[9,8,7]
p.extend(f)
break
print i£¬',',
p.remove(i)

if not p:
break
#expect output is:1,2,3,9,8,7,


¸ßÊÖ°ïÎÒ¿´¿´£¬ÎªÊ²Ã´Îҵò»µ½ÎÒÏëÒªµÄ½á¹ûÄØ,ÓÐʲô·½·¨¿ÉÒԵõ½ÎÒÏëÒªµÄ½á¹ûÂð

for i in p:Ó¦¸ÃÒª¼«Á¦±ÜÃâÈ¥¸Ä±äp¡£whileÀïËæ±ãÆð¸öÕûÊýµ±listϱêÀ´·ÃÎÊÔªËØ£¬È»ºóÑ­»·µÝÔöÕâ¸öÕûÊý...

for i in p:
  ---> iÊÇÁбípµÄÔªËØ
p.remove(i)
  --->Õâ¸öiÊÇÁбípµÄË÷Òý

ÁíÍ⣺
p=[1,2,3,4,5,6]
f=[9,8,7]
p[p.index(4):]=f

¾Í¿ÉÒÔʵÏÖÄãÒªµÄ



ÒýÓÃ

Ò»¡¢½ûÖ¹ÔÚfor±éÀúµÄʱºòÐ޸ı»±éÀúµÄ¶ÔÏó¡£
¶þ¡¢¾¡Á¿ÉÙдforÑ­»·¡£
Èý¡¢Ã»¿´Ã÷°×ÄãÏëÒª×öʲôʵ¼ÊµÄÊÂÇé¡£ÄãÉÔ΢½âÊÍÏ°ɡ£Òª¿´¶®Ò»¶Î´íÎóµÄ´úÂë±¾À´Ïë×öʲôÊÂÇéÊDZȽÏÄѵġ£


ÎÒµÄÒâ˼Êǽ«ÁбíÖÐ4֮ǰµÄÔªËØ´òÓ¡³öÀ´£¬4Ö®ºóµÄ²»´òÓ¡£¬µ«Ã¿´ÎÓö¼û4µÄʱºò»áÓÐÒ»¸öеÄlistÒª´òÓ¡£¬Õâ¸ölistÖÐÒ²ÓпÉÄÜÓÐ4£¬´¦ÀíºÍÇ°ÃælistÒ»Ñù

µ±È»ÎÒʵ¼Ê×÷µÄ¶«Î÷²»ÊÇÕâ¸ö£¬ÕâÖ»ÊÇÎÒ¼ò»¯Ö®ºóдµÄ²âÊÔ´úÂ룬µ«Òâ˼ÊÇÒ»ÑùµÄ£¬¾ÍÊÇ´¦ÀíÒ»¸ölist£¬Åöµ½ÌØÊâÇé¿öÉú³ÉÒ»¸öÐÂlist£¬×ª¶øÈ¥´¦ÀíÕâ¸öÐÂÉú³ÉµÄlist

ÒýÓÃ

ÒýÓà 1 Â¥ iambic µÄ»Ø¸´:

Ò»¡¢½ûÖ¹ÔÚfor±éÀúµÄʱºòÐ޸ı»±éÀúµÄ¶ÔÏó¡£
¶þ¡¢¾


Ïà¹ØÎÊ´ð£º

Ë­ÍƼöÒ»±¾Ñ§Ï°PYTHONµÄÊ飬лл

Ë­ÍƼöÒ»±¾Ñ§Ï°PYTHONµÄÊ飬лл
¡¶python¼òÃ÷½Ì³Ì¡·£¬¡¶pythonºËÐıà³Ì¡·

×÷Ϊϵͳ¹ÜÀí·½Ã棬¡¶Python UNIXºÍLinuxϵͳ¹ÜÀíÖ¸ÄÏ¡·ÊDZ¾·Ç³£²»´íµÄÊé¡£
http://club.book.csdn.net/pic3/255142.jpg

ÒýÓÃ
×÷Î ......

IIS 7 python 2.6 cgi ÎļþÉÏ´«ÎÊÌâ

ÎÒÿ´ÎÉÏ´«µÄÎļþ¶Áµ½µÄÊý¾Ý¶¼²»ÕýÈ·¡£2M µÄͼƬ¶ÁµÃ10¶àK ¡£¡£ÄÄλ´óÏÀ¿ÉÒÔ°ï°ïÎÒ°¡¡£
#!D:\ProgrammerTools\python26\python.exe
#encoding=utf-8
import cgitb
import os
cgitb.enable()
import cgi,urllib ......

pythonÈçºÎ»ñµÃÍøÒ³JavaScript½Å±¾Ö´ÐкóµÄÈ«²¿Ô´´úÂë

RT¡£

ÎÒÏëÒªÏÂÔØÒ»¸öÍøÕ¾ÉϵÄͼƬ£¬µ«ÊǸÃÍøÕ¾µÄͼƬµØÖ·ÊÇͨ¹ýä¯ÀÀÆ÷Ö´ÐÐÍøÒ³µÄJavaScript½Å±¾ºó²Å·µ»ØµÄ£¬Ê¹ÓÃurllib2µÄurlopenÖ»Äܵõ½´øÓÐJavaScript´úÂëµÄÍøÒ³Ô´´úÂë¡£

ÏëÒªÓÃwxÄ£¿éµÄwx.lib.iew ......

python½âÎöxmlÎļþ

ʹÓÃxml.dom½âÎö¼¸Õ×µÄxmlÎļþ£¬·Ç³£»ºÂý£¬ÓÐÖÖ¼ÙËÀµÄ¸Ð¾õ¡£Ôõô½â¾ö£¿ÓÃÆäËû¿âÊÇ·ñ»áºÃЩ£¬ÔÝʱֻ֪µÀÕâ¸ö¿âµÄ¡£
Äã¿ÉÒÔÊÔÒ»ÏÂElementTree


pythonµÄ¹Ù·½Àý×Ó
import xml.parsers.expat

# 3 handler ......

Python£ºÇë½ÌTkÖÐradiobutton¿Ø¼þµÄÁ½¸öÊôÐÔ×÷ÓÃ

ÇëÏÈ¿´ÏÂÃæµÄ¼òµ¥´úÂ룺
Python code:

from tkinter import *
root = Tk()
v = IntVar()
v.set(0)
for i in range(3):
Radiobutton(root,
variable = v,
value = i ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ