当前位置: 首页>>代码示例>>Python>>正文


Python time.minute方法代码示例

本文整理汇总了Python中time.minute方法的典型用法代码示例。如果您正苦于以下问题:Python time.minute方法的具体用法?Python time.minute怎么用?Python time.minute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在time的用法示例。


在下文中一共展示了time.minute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: saveImage

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [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_expired_time

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def get_expired_time(start_time):
    '''

    Returns expired time in HH:MM:SS format calculated relative to start_time

    Parameters
    ----------
    start_time : int
        Starting point in time


    '''
    curr_time = time.time()
    delta = curr_time - start_time
    hour = int(delta / 3600)
    delta -= hour * 3600
    minute = int(delta / 60)
    delta -= minute * 60
    seconds = delta
    return '%02d' % hour + ':%02d' % minute + ':%02d' % seconds 
开发者ID:Vaan5,项目名称:piecewisecrf,代码行数:22,代码来源:train.py

示例3: updateTime

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def updateTime(mc, clockCentre, lastTime, time):
    #draw hour and minute hand
    if (lastTime.minute != time.minute):
        #clear hour hand
        drawHourHand(mc, clockCentre, lastTime.hour, lastTime.minute, 'air')
        #new hour hand
        drawHourHand(mc, clockCentre, time.hour, time.minute, 'dirt')
        
        #clear hand
        drawMinuteHand(mc, clockCentre, lastTime.minute, 'air')
        #new hand
        drawMinuteHand(mc, clockCentre, time.minute, 'STONE')

    #draw second hand
    if (lastTime.second != time.second):
        #clear hand
        drawSecondHand(mc, clockCentre, lastTime.second, 'AIR')
        #new hand
        drawSecondHand(mc, clockCentre, time.second, 'WOOD_PLANKS') 
开发者ID:wensheng,项目名称:JuicyRaspberryPie,代码行数:21,代码来源:minecraft_clock.py

示例4: get_date

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [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

示例5: _combine_date_time

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def _combine_date_time(d, t):
    if (d is not None) and (t is not None):
        return datetime(d.year, d.month, d.day, t.hour, t.minute, t.second)
    return None 
开发者ID:eamigo86,项目名称:graphene-django-extras,代码行数:6,代码来源:date.py

示例6: get_timestamp

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def get_timestamp(self, date, time=None):
        if time != None:
            date += relativedelta(hour=time.hour, minute=time.minute)
        return self.datetime_to_timestamp(date) 
开发者ID:In2ItChicago,项目名称:In2ItChicago,代码行数:6,代码来源:time_utils.py

示例7: min_timestamp_for_day

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def min_timestamp_for_day(self, date):
        if isinstance(date, str):
            date = self.parse_date_string(date)
        return self.get_timestamp(date + relativedelta(hour=0, minute=0)) 
开发者ID:In2ItChicago,项目名称:In2ItChicago,代码行数:6,代码来源:time_utils.py

示例8: max_timestamp_for_day

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def max_timestamp_for_day(self, date):
        if isinstance(date, str):
            date = self.parse_date_string(date)
        return self.get_timestamp(date + relativedelta(hour=23, minute=59)) 
开发者ID:In2ItChicago,项目名称:In2ItChicago,代码行数:6,代码来源:time_utils.py

示例9: set_to_midnight

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def set_to_midnight(self, parsed_date):
        return parsed_date.replace(hour = 0, minute = 0, second = 0, microsecond = 0) 
开发者ID:In2ItChicago,项目名称:In2ItChicago,代码行数:4,代码来源:time_utils.py

示例10: get_time_string

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [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

示例11: get_time

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def get_time():
    '''

    Returns current time in HH:MM:SS format

    '''
    time = datetime.now()
    return '%02d' % time.hour + ':%02d' % time.minute + ':%02d' % time.second 
开发者ID:Vaan5,项目名称:piecewisecrf,代码行数:10,代码来源:train.py

示例12: combine

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def combine(self, date, time):
        return datetime(date.year, date.month, date.day, time.hour, time.minute, time.microsecond, time.tzinfo) 
开发者ID:blackye,项目名称:luscan-devel,代码行数:4,代码来源:datetime_safe.py

示例13: new_datetime

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def new_datetime(d):
    """
    Generate a safe datetime from a datetime.date or datetime.datetime object.
    """
    kw = [d.year, d.month, d.day]
    if isinstance(d, real_datetime):
        kw.extend([d.hour, d.minute, d.second, d.microsecond, d.tzinfo])
    return datetime(*kw)

# This library does not support strftime's "%s" or "%y" format strings.
# Allowed if there's an even number of "%"s because they are escaped. 
开发者ID:blackye,项目名称:luscan-devel,代码行数:13,代码来源:datetime_safe.py

示例14: drawClock

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def drawClock(mc, clockCentre, radius, time):
    drawCircle(mc, clockCentre.x, clockCentre.y, clockCentre.z, radius, 'DIAMOND_BLOCK')
    drawHourHand(mc, clockCentre, time.hour, time.minute, 'DIRT')
    drawMinuteHand(mc, clockCentre, time.minute, 'STONE')
    drawSecondHand(mc, clockCentre, time.second, 'WOOD_PLANKS') 
开发者ID:wensheng,项目名称:JuicyRaspberryPie,代码行数:7,代码来源:minecraft_clock.py

示例15: __init__

# 需要导入模块: import time [as 别名]
# 或者: from time import minute [as 别名]
def __init__(self, offset):
        """
        @param offset: The fixed offset of the timezone.
        @type offset: I{int} or B{datetime}.I{timedelta}

        """
        if type(offset) == int:
            offset = datetime.timedelta(hours=offset)
        elif type(offset) != datetime.timedelta:
            raise TypeError("timezone offset must be an int or "
                "datetime.timedelta")
        if offset.microseconds or (offset.seconds % 60 != 0):
            raise ValueError("timezone offset must have minute precision")
        self.__offset = offset 
开发者ID:suds-community,项目名称:suds,代码行数:16,代码来源:date.py


注:本文中的time.minute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。