Python测试网速 2022-12-19 内容目录 当然我们在开始测网速之前需要提前下载好依赖的模块 1 2 3 pip install speedtest-cli 然后我们开始尝试测试一下网速: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 from speedtest import Speedtest def Testing_Speed(net): download = net.download() upload = net.upload() print(f'下载速度: {download/(1024*1024)} Mbps') print(f'上传速度: {upload/(1024*1024)} Mbps') print("开始网速的测试 ...") net = Speedtest() Testing_Speed(net) Author grabbyte LastMod 2022-12-19