一、安装speedtest-cli
C:\Users\liulinfeng>pip install speedtest-cli
Collecting speedtest-cli
Using cached speedtest_cli-2.1.3-py2.py3-none-any.whl (23 kB)
Installing collected packages: speedtest-cli
Successfully installed speedtest-cli-2.1.3
二、Dos切换windows目录到脚本所在目录
C:\Users\liulinfeng>cd C:\Users\liulinfeng\Desktop\py++
三、执行测速脚本
测速脚本代码有点长,放到最后,先看执行结果:
四、Python代码:
#!/usr/bin/env python
# -*-