摘要: #事件,就是多线程之间的通信 import threading, time class Boss(threading.Thread): def run(self): print("Boss说:从现在开始我们就要996啦,欢呼吧") #事件设置 print(event.isSet()) event.s 阅读全文
posted @ 2019-12-30 16:16 老方学编程 阅读(752) 评论(0) 推荐(0) 编辑
摘要: import threading # 通过函数调用的方式实现多线程 def my_print(info): time.sleep(random.randint(1,10)) print(info + "被执行") if __name__ == __main__: t1 = threading.Thr 阅读全文
posted @ 2019-12-30 15:42 老方学编程 阅读(427) 评论(0) 推荐(0) 编辑
摘要: 使用日志需要 import logging 日志常用分级为四个级别 debug 调试级别的日志 info 信息级别的日志 warning 警告级别的日志 error 错误级别的日志 logging.debug("this is a debug log") loggging.inro("this is 阅读全文
posted @ 2019-12-30 14:42 老方学编程 阅读(217) 评论(0) 推荐(0) 编辑