本文整理汇总了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
示例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