随笔分类 - python
摘要:1.split 将一个字符串拆分成一个子字符串列表,列表中的子字符串正好可以构成原字符串。 两个参数: 第一个参数表示使用哪个字符进行拆分。 第二个参数表示进行拆分的次数(两次拆分,可得3 个子字符串) #1、无参数 string1 = "My deliverable is due in May"
阅读全文
摘要:pip install 包名 -i http://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com
阅读全文
摘要:1、使用psutil库计算实时上下传的网速 # coding:utf-8 import psutil import time def getNet(): sent_before = psutil.net_io_counters().bytes_sent # 已发送的流量 recv_before =
阅读全文