![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Hakim2015
这个作者很懒,什么都没留下…
展开
-
Python 查询的数据库中的数据 关键值转换成键值对形式
数据库中获取的数据data = ((1, '无标签'), (2, '词根词缀'), (3, '中口背诵单词'), (4, '新概念3'), (5, 'ebs'), (6, '黄老师翻译'), (7, 'sherlock holmes'))目标数据to_data =[ { "name": "无标签", "value": 1原创 2017-10-07 13:47:50 · 2463 阅读 · 0 评论 -
python 缺位补齐
目标长度20 指定填充字符str.ljust(20) assert s #指定字符是 空格str.rjust(20)str.center(20)左侧填充0str.zfill(20)原创 2017-10-07 16:02:41 · 574 阅读 · 0 评论 -
python xxxA.py 调用 xxxB.py 中的方法
起初只是创建了文件夹,直接在文件夹里创建的python代码,现在需要包之间的相互调用!所需要进行的设置:模块的命名需要规范 不能以数字开始改文件下需要存在 __init__.py 文件如何引用同一module下的其他xxx.py 下的方法from _10python import _171007dict163_db_10python 是mod原创 2017-10-07 12:56:51 · 2087 阅读 · 1 评论 -
python 异常的处理
import tracebacktry: # execute this sql cursor.execute(sql, params) # cursor.execute(sql) # commit to mysql datebase to execute conn.commit()except: print('error happ原创 2017-10-07 23:24:27 · 412 阅读 · 0 评论 -
Python MD5加密算法
import hashlibstr = 'abcdefg'str = str.encode('gbk')m = hashlib.md5()m.update(str)print(m.hexdigest())print(m.digest())原创 2017-10-08 00:28:03 · 547 阅读 · 0 评论 -
Python 数据批量插入 MySQL
TODO原创 2017-10-08 10:54:15 · 578 阅读 · 0 评论