摘要: About 在没完善一个程序之前,我们不知道程序在哪里会出错,与其让它在运行最崩溃,不如在出现错误条件时就崩溃。 这时,就要用到断言assert了,Python中的断言语句格式用法很简单。 断言 assert 是指期望用户指定的条件满足,它是当用户定义的约束条件不满足时触发AssertionErro 阅读全文
posted @ 2020-01-19 20:59 干it的小张 阅读(356) 评论(0) 推荐(0) 编辑
摘要: import timeimport requests#线程池、进程池from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor#多线程:from threading import Thread#多进程:from mult 阅读全文
posted @ 2020-01-19 20:42 干it的小张 阅读(204) 评论(0) 推荐(0) 编辑
摘要: import timeimport requests#线程池、进程池from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor#多线程:from threading import Thread#多进程:from mult 阅读全文
posted @ 2020-01-19 20:41 干it的小张 阅读(228) 评论(0) 推荐(0) 编辑
摘要: About psutil(python系统和流程实用程序)是一个跨平台库,用于在Python中检索有关正在运行的 进程和系统利用率(CPU,内存,磁盘,网络,传感器)的信息。它主要用于系统监视,分析,限制进程资源和运行进程的管理。它实现了UNIX命令行工具提供的许多功能,例如:ps,top,lsof 阅读全文
posted @ 2020-01-19 20:11 干it的小张 阅读(324) 评论(0) 推荐(0) 编辑