当前位置: 首页>>代码示例>>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;未经允许,请勿转载。