configparser模块
import configparser
config = configparser.ConfigParser()
#将配置写入到文件
config['DEFAULT'] = {'ServerAliveInterval': '',
'Compression': 'yes',
'CompressionLevel': ''}
config['bitbucket.org'] = {'User': 'fansik'}
config['www.fansik.com'] = {'Host Port': '',
'ForwardX11': 'no'}
config['DEFAULT']['ForwardX11'] = 'yes' with open('example.ini', 'w') as configfile:
config.write(configfile) # 读取配置
config.read('example.ini', encoding='utf8')
print(config.sections())
print(config.defaults())
for key in config['bitbucket.org']: # 这个key包含DEFAULT中的内容
print(key) # 修改配置
config.remove_section('bitbucket.org')
config.has_section('bitbucket.org') # 判断是否删除成功
config.write(open('example.ini', 'w'))
# 修改单个的配置
config.set('www.fansik.com', 'forwardx11', 'yes')
# 删除单个配置
config.remove_option('www.fansik.com', 'forwardx11')

hashlib加密模块

import hashlib
password = hashlib.md5()
password.update('fanjinbao'.encode('utf8'))
print(password)
print(password.hexdigest())
password.update('fansik'.encode('utf8'))
print(password.hexdigest()) password2 = hashlib.sha256()
password2.update('fanjinbao'.encode('utf8'))
print(password2.hexdigest()) password3 = hashlib.sha256()
password3.update('fanjinbao'.encode('utf8'))
print(password2.hexdigest())

最新文章

  1. android 中layer-list的用法
  2. RCP:如何移除Search对话框中不需要的项
  3. Activity 和 生命周期: 创建
  4. Java基础(39):数据的四舍五入、去整、产生随机数---Math类的应用
  5. c++ encode decode
  6. tools/adb: No such file or directory
  7. 虚拟桌面基础架构(VDI)与终端服务和传统PC对比
  8. [转载]如何打一手好Log
  9. C#/PHP Compatible Encryption (AES256) ZZ
  10. Register/unregister a dll to GAC
  11. v4l2视频采集摄像头
  12. Linux(CentOS6.7) 安装MySql5.7数据库
  13. spring框架整合hibernate框架简单操作数据库
  14. failed to find global analyzer [uax_url_email]
  15. [leetcode]61. Rotate List旋转链表
  16. socketv 验证客户端链接的合法性,socketserver
  17. ArrayList、LinkList、Vector的区别
  18. react+dva+antd项目构建
  19. 085 HBase的二级索引,以及phoenix的安装(需再做一次)
  20. oracle锁---原理篇

热门文章

  1. linux命令ulimit 系统限制你打开一些资源数
  2. opengl剪裁空间和视口空间中不遵从右手定则,而是遵从左手定则
  3. Spring mvc 注解@ResponseBody 返回内容编码问题
  4. Flex colorTranfrom使用说明
  5. UML类图详解_泛化关系
  6. 百度UEditor 用require 引入 Thinkphp5 ,图片上传问题
  7. scp -P 非22端口拷贝
  8. SecureCRTPortable.exe 如何上传文件
  9. Spring MVC静态页面
  10. 用VS2010进行CMAKE的时候“LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏”