python timeÄ£¿éÏê½â
python µÄÄÚǶtimeÄ£°å·Ò뼰˵Ã÷
Ò»¡¢¼ò½é
timeÄ£¿éÌṩ¸÷ÖÖ²Ù×÷ʱ¼äµÄº¯Êý
˵Ã÷£ºÒ»°ãÓÐÁ½ÖÖ±íʾʱ¼äµÄ·½Ê½:
µÚÒ»ÖÖÊÇʱ¼ä´ÁµÄ·½Ê½(Ïà¶ÔÓÚ1970.1.1 00:00:00ÒÔÃë¼ÆËãµÄÆ«ÒÆÁ¿),ʱ¼ä´ÁÊÇΩһµÄ
µÚ¶þÖÖÒÔÊý×éµÄÐÎʽ±íʾ¼´(struct_time),¹²ÓоŸöÔªËØ£¬·Ö±ð±íʾ£¬Í¬Ò»¸öʱ¼ä´ÁµÄstruct_time»áÒòΪʱÇø²»Í¬¶ø²»Í¬
year (four digits, e.g. 1998)
month (1-12)
day (1-31)
hours (0-23)
minutes (0-59)
seconds (0-59)
weekday (0-6, Monday is 0)
Julian day (day in the year, 1-366)
DST (Daylight Savings Time) flag (-1, 0 or 1) ÊÇ·ñÊÇÏÄÁîʱ
If the DST flag is 0, the time is given in the regular time zone;
if it is 1, the time is given in the DST time zone;
if it is -1, mktime() should guess based on the date and time.
ÏÄÁîʱ½éÉÜ£ºhttp://baike.baidu.com/view/100246.htm
UTC½éÉÜ£ºhttp://wenda.tianya.cn/wenda/thread?tid=283921a9da7c5aef&clk=wttpcts
¶þ¡¢º¯Êý½éÉÜ
1.asctime()
asctime([tuple]) -> string
½«Ò»¸östruct_time(ĬÈÏΪµ±Ê±Ê±¼ä)£¬×ª»»³É×Ö·û´®
Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.
When the time tuple is not present, current time as returned by localtime()
is used.
2.clock()
clock() -> floating point number
¸Ãº¯ÊýÓÐÁ½¸ö¹¦ÄÜ£¬
ÔÚµÚÒ»´Îµ÷ÓõÄʱºò£¬·µ»ØµÄÊdzÌÐòÔËÐеÄʵ¼Êʱ¼ä£»
ÒÔµÚ¶þ´ÎÖ®ºóµÄµ÷Ó㬷µ»ØµÄÊÇ×ÔµÚÒ»´Îµ÷Óúó,µ½Õâ´Îµ÷ÓõÄʱ¼ä¼ä¸ô
ʾÀý£º
import time
if __name__ == '__main__':
time.sleep(1)
print "clock
Ïà¹ØÎĵµ£º
ÔÚWindowsÀï´î½¨PythonµÄGTK+»·¾³»¹ÊDZȽÏÂé·³µÄÓÐÒÔϼ¸¸ö×¢ÒâÊÂÏî
1¡¢PyGTKÍøÕ¾ÉÏϵİü£¬¿ÉÄÜûÓÐGladeÀࣨLib\site-packages\gtk-2.0\gtkĿ¼ÏÂûÓÐglade.pyd£©£¬Èç¹ûûÓÐÕâ¸öÀàÄã¾ÍÎÞ·¨ÔÚ³ÌÐòÀïµ¼ÈëGlade¹¤¾ß´´½¨µÄxml£¬ÊÖд½çÃ滹ÊÇͦÂé·³µÄ¡£
2¡¢GTKÍøÕ¾ÉϵÄGTK°ü£¬Ã»ÓаüÀ¨GladeµÄDLLÎļþ£¬»¹ÊÇÎÞ·¨¶ÁÈëGladeµÄxm ......
Ö»ÐèÒªÔÚÎļþÖÐimportÓëÄãдµÄÎļþµÄÎļþÃûÒ»ÖµÄÄ£¿éÃû¼´¿É£¬Õâʱpython»áΪÄã´´½¨Ò»¸öpycÎļþµÄ¡£
¼´£¬Èç¹ûÄãÒѾдÁËÒ»¸öÃûΪssss.pyµÄÎļþ£¬¶øÏÖÔÚÄãÐèÒªÔÚÃûΪaaaa.pyµÄÎļþÖÐʹÓÃssss.pyÖж¨ÒåµÄ·½·¨£¬ÄÇôÄãÖ»ÐèÒªÔÚaaaa.pyÖмÓÈëimport ssss£¬È»ºóÄã¾Í¿ÉÒÔÔÚaaaa.pyÖÐʹÓÃssss.pyÖеķ½·¨£¨µ±È»·½·¨Ç°ÐèÒª¼ÓÄ£¿éÃû ......
http://cocobear.info/blog/2009/01/16/use-python-deal-with-excel/
ʹÓÃPython´¦ÀíExcel±í¸ñ 2009Äê01ÔÂ16ÈÕ
¸ø°³µÄbossдµÄÒ»¸öС¹¤¾ß£¬Ê¹ÓÃPython¶ÔExcel½øÐÐͳ¼Æ£¬È»ºó°Ñ½áÊøÉú³ÉÒ»¸öеÄExcel±í¸ñ£¬Ê¹Óõ½ÁËxlrdºÍpyExceleratorÁ½¸ö¿â¡£
¼òµ¥µÄ½éÉÜÒ»ÏÂÕâÁ½¸ö¿â£¬ÏÈ˵xlrd£¬Õâ¸ö¿â¶ÁExcel±È½Ï·½±ã£¬¸÷ÖÖ·½·¨Ê¹ÓÃÆ ......
http://bbs.chinaunix.net/thread-1586782-1-1.html
ÎÒ¸Õ¸ÕÓÃpythonдÁËÒ»¶Î²Ù×÷excelµÄ½Å±¾£¬Ä¿µÄÊÇ°ÑÒ»¸öexcelÎļþ°´ÕÕijһÁÐÖеÄ×ֶβð·Ö³É¶à¸öÎļþ£¬ÀýÈç°´ÕÕ³ÇÊлòÕßÊ¡·ÝµÈ£¬µ«ÊÇ·¢ÏÖ´¦ÀíÒ»¸ö1700ÐеÄÎļþ²ð·Ö³É40¶à¸öÎļþʱҪÔËÐÐ30·ÖÖÓ×óÓÒ£¬ÐÔÄÜÌ«Âý£¬Çë¸ßÊÖ°ïæ¿´¿´Ôõô²ÅÄÜÓÅ»¯ÐÔÄÜ£¬Ð»Ð»¡£
ÐÂÊÖдµÄ½Å±¾£¬Çë²» ......
CSDNÕ¾ÄÚתÌû£º
http://blog.csdn.net/kiki113/archive/2009/03/28/4033017.aspx
python µÄÄÚǶtimeÄ£°å·Ò뼰˵Ã÷
Ò»¡¢¼ò½é
timeÄ£¿éÌṩ¸÷ÖÖ²Ù×÷ʱ¼äµÄº¯Êý
˵Ã÷£ºÒ»°ãÓÐÁ½ÖÖ±íʾʱ¼äµÄ·½Ê½:
µÚÒ»ÖÖÊÇʱ¼ä´ÁµÄ·½Ê½(Ïà¶ÔÓÚ1970.1.1 00:00:00ÒÔÃë¼ ......