speedtest-cli 测试电脑的网络带宽大小
作者:互联网
安装 pip install speedtest-cli 我的是 Successfully installed speedtest-cli-2.1.3
import speedtest、
# 创建测试对象
test = speedtest.Speedtest()
down = test.download()
upload = test.upload()
print(f"上传速度:{round(upload/(1024 * 1024),2)} Mbps")
print(f"下载速度:{round(down/(1024 * 1024),2)} Mbps")
标签:1024,cli,speedtest,upload,down,test,网络带宽 来源: https://www.cnblogs.com/hany-postq473111315/p/15314222.html