摘要: format方式 数字格式的定义以 ':' 号开始。碰到了': '字符就知道要定义一个数字的显示格式了。格式的定义顺序为 [[fill]align][sign][#][0][width][,][.precision][type] fill 【可选】空白处填充的字符 align 【可选】对齐方式(需配 阅读全文
posted @ 2021-02-14 22:06 xuwenwei 阅读(83) 评论(0) 推荐(0)
摘要: python字符串格式化 Python的字符串格式化有两种方式:%格式符方式,format方式 %格式符 %[(name)][flags][width].[precision]typecode (name) 可选,用于选择指定的key flags 可选,可供选择的值有: + 右对齐;正数前加正好,负 阅读全文
posted @ 2021-02-14 22:05 xuwenwei 阅读(44) 评论(0) 推荐(0)
摘要: # !/usr/bin/env python # -*- coding:utf8 -*- import hashlib def login(username, pwd): with open("user.db", 'r', encoding='utf-8') as f: while True: li 阅读全文
posted @ 2021-02-14 21:46 xuwenwei 阅读(72) 评论(0) 推荐(0)
摘要: import hashlib hash = hashlib.md5(bytes('88888', encoding='utf-8')) hash.update(bytes('1235678', encoding='utf-8')) print(hash.hexdigest()) 阅读全文
posted @ 2021-02-14 20:19 xuwenwei 阅读(26) 评论(0) 推荐(0)