摘要: def is_between(start_at, end_at) -> bool: """ 判断当前时间是否在指定时间之间 例如:指定时间段为[09:00:00, 18:00:00]若当前时间是 2021年8月16日17:53:45 ,判断是否在这个时间段,返回 True 另外:若指定时间段为[22 阅读全文
posted @ 2021-08-16 18:28 _迷途 阅读(959) 评论(0) 推荐(0) 编辑
摘要: Python string强转int def to_int(my_str) -> (int, bool): try: int(my_str) return int(my_str) except ValueError: # 报类型错误,说明不是整型的 try: float(my_str) # 用这个来 阅读全文
posted @ 2021-08-16 17:20 _迷途 阅读(390) 评论(0) 推荐(0) 编辑