當前位置: 首頁>>代碼示例>>Python>>正文


Python time.day方法代碼示例

本文整理匯總了Python中time.day方法的典型用法代碼示例。如果您正苦於以下問題:Python time.day方法的具體用法?Python time.day怎麽用?Python time.day使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在time的用法示例。


在下文中一共展示了time.day方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: saveImage

# 需要導入模塊: import time [as 別名]
# 或者: from time import day [as 別名]
def saveImage():
	keepDiskSpaceFree(config.diskSpaceToReserve)
	time = datetime.datetime.now()
	filenameFull = config.filepath + config.filenamePrefix + "-%04d%02d%02d%02d%02d%02d" % (time.year, time.month, time.day, time.hour, time.minute, time.second)+ "." + config.fileType
	
	# save onto webserver
	filename = "/var/www/temp.jpg"
	subprocess.call("sudo raspistill -w "+ str(config.saveWidth) +" -h "+ str(config.saveHeight) + " -t 1 -n -vf -e " + config.fileType + " -q 15 -o %s" % filename, shell=True)
	print "Captured image: %s" % filename

	theSpeech = recognizeFace(filename,filenameFull)
	if len(theSpeech)>2:
		print theSpeech
		saySomething(theSpeech,"en")
		config.lookForFaces = 0


# Keep free space above given level 
開發者ID:schollz,項目名稱:rpi_ai,代碼行數:20,代碼來源:visual_cortex.py

示例2: get_date

# 需要導入模塊: import time [as 別名]
# 或者: from time import day [as 別名]
def get_date():
    '''
    This creates a string of the day, hour, minute and second
    I use this to make folder names unique
    
    For the files themselves, I generate genuinely unique names (i.e. name001.csv, name002.csv, etc.)
    '''
    time = datetime.datetime.now()
    time_str = "{}y{}m{}d{}h{}m{}s".format(time.year,time.month,time.day,time.hour,time.minute,time.second)
    return(time_str) 
開發者ID:a-n-rose,項目名稱:Build-CNN-or-LSTM-or-CNNLSTM-with-speech-features,代碼行數:12,代碼來源:extract_features.py

示例3: get_time_string

# 需要導入模塊: import time [as 別名]
# 或者: from time import day [as 別名]
def get_time_string():
    '''

    Returns current time in day_month_HH-MM-SS/ format

    '''
    time = datetime.now()
    name = (str(time.day) + '_' + str(time.month) + '_%02d' % time.hour +
            '-%02d' % time.minute + '-%02d' % time.second + '/')
    return name 
開發者ID:Vaan5,項目名稱:piecewisecrf,代碼行數:12,代碼來源:train.py


注:本文中的time.day方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。