pythonÖеÄlistÈçºÎ½øÐÐÏà¼õ²Ù×÷»òÕß½«list·ÖƬ
ÎÊÌâÃèÊö£º¼ÙÉèÎÒÓÐÕâÑùÁ½¸ölist£¬
Ò»¸öÊÇlist1£¬list1 = [1, 2, 3, 4, 5]
Ò»¸öÊÇlist2£¬list2 = [1, 4, 5]
ÎÒÃÇÈçºÎµÃµ½Ò»¸öеÄlist£¬list3£¬
list3ÖаüÀ¨ËùÓв»ÔÚlist2ÖгöÏÖµÄlist1ÖеÄÔªËØ¡£
¼´£ºlist3 = list1 - list2
½â¾ö·½°¸£ºÎÒÃÇ¿ÉÒÔÓÃset£¨¼¯ºÏ£©²Ù×÷
list3 = list(set(list1) - set(list2))
set²Ù×÷»á½«Ò»¸ölistת»»³ÉÒ»¸ö¼¯ºÏ¡£
¼ÙÉ裺list_t = [1, 2, 3, 1]
ÄÇô£ºlist(set(list_t)) = [1, 2, 3]
Êǵģ¬Öظ´µÄÏî»á±»É¾³ý¡£
ÆäËû·½°¸£ºlist3 = [i for i in list1 if i not in list2] #¿ÉÓÃÓÚlist·ÖƬ
ÕâÑùдҲºÜÖ±¹Û¡£
µ«ÊÇÔÚlistºÜ´óµÄʱºò£¬Ã»ÓÐset·½·¨¿ì¡£
¶îÍâ֪ʶ£ºa = [[i,j] for i in range(2) for j in range(3)]
Õâ¸öºÍ“ÆäËû·½°¸”·Ç³£ÏàËÆ£¬
¶¼ÊÇÔÚ[]ÀïÃæ½øÐÐÅжϺͼÆËã¡£
¸Ð¾õºÜ·½±ã£¬ÖÁÉÙ±ÈÏÂÃæÕâÑùÒª·½±ã¡¢Òª¿ì£º
a = []
for i in range(2):
for j in range(3):
&nb
Ïà¹ØÎĵµ£º
>>> import time
>>> import datetime
>>>
now = time.localtime()
>>> now
(2006, 4, 30, 18, 7, 35,
6, 120, 0)
>>> type(now)
<type 'time.struct_time'>
>>>
str_now = time.strftime("%m/%d/%Y %X", now )
>>>
str_n ......
¹ØÓÚPython£¬±¾È˲»Ïë¶à˵ÁË£¬Èç¹û²»ÖªµÀʲôÊÇPython£¬¿ÉÒÔ¿´¡¶Ê²Ã´ÊÇPython
£¿¡·Ò»ÎÄ¡£Python¿ÉÒÔ¿ª·¢CGI³ÌÐò£¬ÄÇôÔÚApacheÏÂÓ¦ÈçºÎÅäÖÃÄØ£¿±¾ÎÄÖ»½²ÊöÁËÈçºÎ
ÒÔCGI·½Ê½ÅäÖÃApache£¬Ê¹ÆäÖ§³ÖPython³ÌÐò¡£ÆäËü·½Ê½£¬Èçmod_pythonÔò²»ÔÚÌÖÂÛ·¶Î§
(ÆäʵÊÇûÅä³É¹¦:-)¡£ÎÒËùʹÓõÄϵͳ»·¾³ÎªWindows 2000, Apache 1.3.19£ ......
“¹þ¹þ£¡ÖªµÀÎÒ²Ù×÷Ö®ÍõС°×µÄÀ÷º¦ÁË°É£¡”
ÿµ±ÖÜÁùÍíÉÏ£¬Ð¡°××ÜÊÇÒª¸úËÞÉáµÄµÜÐÖÌô¼¸¾ÖħÊÞ¡£Æ¾½è×Å·çɧµÄ×ßλºÍâ«ËöµÄÒâʶ£¬Ð¡°××ÜÊÇЦµÀ×îºó¡£Õâ²»£¬Ð¡°×ÓÖÒ»´ÎÈ¡µÃÁËÒÔÒ»µÐ¶þµÄʤÀû¡£
“Ö÷ÒªÊǶàÏß²Ù×÷£¡”ÕâÊÇС°×¶Ô×Ô¼ºÊ¤ÀûµÄ×ܽ ......
³¬Èº.comµÄ²©¿Í
Pythonת»»office wordÎļþΪHTML
ÕâÀï²âÊԵĻ·¾³ÊÇ£ºwindows xp,office 2007,python 2.5.2,pywin32 build
213£¬ÔÀíÊÇÀûÓÃwin32com½Ó¿ÚÖ±½Óµ÷ÓÃoffice
API£¬ºÃ´¦ÊǼòµ¥¡¢¼æÈÝÐԺã¬Ö»ÒªofficeÄÜ´¦ÀíµÄ£¬python¶¼¿ÉÒÔ´¦Àí£¬´¦Àí³öÀ´µÄ½á¹ûºÍoffice wordÀïÃæ“Áí´æΪ”Ò»Ö¡£
#!/usr/bin/en ......