会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
洗洗睡吧
自闭。。。。。。
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
24
25
26
27
28
29
30
31
32
···
51
下一页
2021年5月14日
PrettyTable模块
摘要: # 用来生成美观的ASCII格式的表格 pip install prettytable # 导入 from prettytable import PrettyTable # 使用 tb = pt.PrettyTable() # 头部信息 tb.field_names = [] # 设置字段列名 #
阅读全文
posted @ 2021-05-14 17:50 我在路上回头看
阅读(117)
评论(0)
推荐(0)
2021年5月12日
calendar模块
摘要: calendar.timegm(tupletime) # 将一个时间元组转换为时间戳
阅读全文
posted @ 2021-05-12 17:47 我在路上回头看
阅读(66)
评论(0)
推荐(0)
python开发接口时,使用jsonschema模块对数据进行校验
摘要: import jsonschema schema = { "type": "object", # 先声明每个键都是对象 "properties": { # 声明每个键对应的值的类型 "version_no": {"type": "string"}, "versions": { "type": "ar
阅读全文
posted @ 2021-05-12 17:42 我在路上回头看
阅读(413)
评论(0)
推荐(0)
python中动态生成类type的用法
摘要: 示例:正常创建类 class Person(object): def __init__(self): self.name = name self.age = age p = Person("Alex", 22) """ python中一切皆对象:上面代码中,我们可以看到首先p对象是由Person类实
阅读全文
posted @ 2021-05-12 17:41 我在路上回头看
阅读(191)
评论(0)
推荐(0)
abc模块的用法
摘要: 首先需要了解的是一个基类(父类),abc.ABCMeta。这个是用于实现抽象类的一个基础类 抽象方法的使用,在相应的方法之前一行加上@abstractmethod之后,从新的一行开始定义相应的方法。实现的方法就是一个抽象方法。子类继承之后,如果需要用到的这个方法则必须用新的方法将其实现。 示例代码
阅读全文
posted @ 2021-05-12 17:40 我在路上回头看
阅读(396)
评论(0)
推荐(0)
python操作txt文件,去除文件中的隔行空行
摘要: conn = re.sub(result, '\r\n', content) res = "".join( [s for s in conn.strip().splitlines(True) if s.strip()])
阅读全文
posted @ 2021-05-12 17:28 我在路上回头看
阅读(1040)
评论(0)
推荐(0)
2021年5月7日
matplotlib画图中x轴过于密集的解决办法
摘要: import matplotlib.ticker as ticker ax.xaxis.set_major_locator(ticker.MultipleLocator(base=10)) # ticker.MultipleLocator中的参数base是x轴显示的间隔
阅读全文
posted @ 2021-05-07 21:30 我在路上回头看
阅读(2677)
评论(0)
推荐(0)
2021年4月23日
chrony同步时间
摘要: chrony文件组成 包:chrony 两个主要程序:chronyd和chronyc - chronyd:后台运行的守护进程,用于调整内核中运行的系统时钟和时钟服务同步。它确定计算机增减时间的比率,并对此进行补偿 - chronyc: 命令行用户工具,用于监控性能并进行多样化的配置。它可以在chro
阅读全文
posted @ 2021-04-23 10:17 我在路上回头看
阅读(838)
评论(0)
推荐(0)
2021年4月15日
select_for_update悲观锁
摘要: 例子,银行存款和撤销方法 1、用户A提取帐户 - 余额为100 $。 2、用户B提取帐户 - 余额为100 $。 3、用户B退出30 \(- 余额更新为100\) - 30 \(= 70\)。 4、用户A存款50 \(- 余额更新为100\) + 50 \(= 150\)。 这里发生了什么? 用户B
阅读全文
posted @ 2021-04-15 15:56 我在路上回头看
阅读(247)
评论(0)
推荐(0)
tox包
摘要: 官方文档 https://tox.readthedocs.io/en/latest/example/basic.html 官方提供的一个简单的tox.ini/默认环境 [tox] envlist = py27,py36 [testenv] deps = pytest commands = pytes
阅读全文
posted @ 2021-04-15 14:09 我在路上回头看
阅读(190)
评论(0)
推荐(0)
上一页
1
···
24
25
26
27
28
29
30
31
32
···
51
下一页
公告