__init__.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:pyirobot 作者: cseelye 项目源码 文件源码
def GetTime(self):
        """
        Get the time this robot is set to

        Returns:
            A dictionary with the time of day and day of week (dict)
        """
        result = self._PostToRobot("get", "time")
        day_idx = [idx for idx, day in enumerate(calendar.day_abbr) if day.lower() == result["d"]][0]
        return {
            "time" : datetime.time(result["h"], result["m"]),
            "weekday" : calendar.day_name[day_idx]
        }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号