协程与线程的简单区分

线程需要提前指定同时进行的数量,而协程不需要,...

字串格式化换format使用

传送地址: IT虾米网...

使用协程实现多个网址同时请求,并异步处理接收到的数据

实现目的: 对百度同时发起100个请求,并异步处理请求的结果 关键技术: 使用队列存储请求的结果 代码如下 # author: luojun # date: 2020/1/6 16:43 from geven...

python 环境变量设置,文件查找路径设置

DIR = os.path.dirname(__file__) sys.path.insert(0, os.path.abspath( os.path.join(DIR, '_extensions')))...

python 日志logging级别及使用

日志级别有以下5种: 1.static Level DEBUG :     DEBUG Level指出细粒度信息事件对调试应用程序是非常有帮助的。  2.static Level INFO     INFO level表明 消息在粗...

Python使用pyserial进行串口通信

硬件通信, IT虾米网...

grequests异步请求

import grequests from bs4 import BeautifulSoup def get_title(rep): soup = BeautifulSoup(rep.text, 'html.parser'...

编码对象或者字串中包含Unicode字符怎样转换为中文

In [18]: c = '你好' In [20]: d = c.encode('unicode_escape')...

python 推导式多个for循环

示例如下: In [5]: [(i,j) for i in range(10) for j in range(2) ]...

python GUI编程/窗口编程之easygui

IT虾米网 有时候开发小程序,还是有个图形化界面比较好看,easygui操作起来相对较简单....