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
Ïà¹ØÎĵµ£º
Python×î´óµÄÌØµã¾ÍÔÚÓÚËýµÄ¿ìËÙ¿ª·¢¹¦ÄÜ¡£×÷ΪһÖÖ½ºË®ÐÍÓïÑÔ£¬python¼¸ºõ¿ÉÒÔÉøÍ¸ÔÚÎÒÃDZà³Ì¹ý³ÌÖеĸ÷¸öÁìÓò¡£ÕâÀïÎÒ¼òµ¥½éÉÜÒ»ÏÂÓÃpython½øÐÐgui¿ª·¢µÄһЩѡÔñ¡£
1.Tkinter
TkinterËÆºõÊÇÓëtclÓïÑÔͬʱ·¢Õ¹ÆðÀ´µÄÒ»ÖÖ½çÃæ¿â¡£tkinterÊÇpythonµÄÅ䱸µÄ±ê×¼gui¿â£¬Ò²ÊÇopensourceµÄ²úÎï¡£Tkinter¿ÉÓÃÓÚwin ......
ÏÂÃæÊǶÔijÎļþ¼Ð϶à¸öÎļþÏÂÖ¸¶¨Îļþ»»Ãû×ÖµÄʵÀý£¨ÎªÁË»»Ãû×Ö£¬ÒòΪÀÁµÃÊÖ¶¯¸Ä£¬ÕÛÌÚÁËÒ»»á¸ã³öÀ´µÄ£©
ÔÀíºÜ¼òµ¥£¬»»ÎļþÃûµÄ»°Ö¸¶¨path¾ÍÐÐ £¬¾ßÌåµÄ×Ô¼º¿´°É£¬½ö¹©²Î¿¼£¡
#-*- coding:utf-8 -*-
import os,sys
#=======================================
##¶Ô¶à¸öÎļþ¼ÐϵÄÎļþ£¨¼Ð£©½øÐд¦Àí
#============ ......
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·ÖÖÓ×óÓÒ£¬ÐÔÄÜÌ«Âý£¬Çë¸ßÊÖ°ïæ¿´¿´Ôõô²ÅÄÜÓÅ»¯ÐÔÄÜ£¬Ð»Ð»¡£
ÐÂÊÖдµÄ½Å±¾£¬Çë²» ......