# import configparser
#
# config = configparser.ConfigParser() #config = {} # config['DEFAULT'] = {'ServerAliveInterval':'45',
# 'Compression':'yes',
# 'CompressionLevel':'9'}
#
# config['bitbucket.org'] = {}
# config['bitbucket.org']['User'] = 'hg'
#
# config['topsecret.server.com'] = {}
# topsecret = config['topsecret.server.com']
# topsecret['Host Port'] = '50022'
# topsecret['ForwardX11'] = 'no'
# config['DEFAULT']['ForwardX11'] = 'yes'
#
#
# with open('example.ini','w') as f:
# config.write(f) import configparser config = configparser.ConfigParser() #config = {}
config.read('example.ini') # 查
# print(config.sections())
# print('bytehong.com' in config)
# print(config['bitbucket.org']['User'])
# print(config['DEFAULT']['Compression'])
# print(config['topsecret.server.com']['ForwardX11']) # for key in config['bitbucket.org']:
# print(key) # print(config.options('bitbucket.org'))
# print(config.items('bitbucket.org'))
# print(config.get('bitbucket.org','compression')) # 增
# config.add_section('hello')
# config.set('hello','k1','123') # 删
# config.remove_section('topsecret.server.com')
# config.remove_option('bitbucket.org','User') config.write(open('test.txt','w'))

  

# 用于加密相关的操作,主要提sha1,sha224,sha384,sha512,md5算法
# 算法越复杂,消耗的时间越多
import hashlib # obj = hashlib.md5('sb'.encode('utf-8')) obj = hashlib.md5() # obj.update("hello".encode('utf-8'))
# print(obj.hexdigest()) # obj.update('helloroot'.encode('utf-8'))
# print(obj.hexdigest())

  

最新文章

  1. opencv在图像显示中文
  2. 我喜欢ASP.NET的MVC因为它牛逼的9大理由(转载)
  3. TaggingJS – 可以灵活定制的 jQuery 标签系统插件
  4. 简单的angular表单验证指令
  5. Linux(Ubuntu) 和 Python 常用命令
  6. php 函数preg_match、preg_match_all ,以及正则表达式规则
  7. [Unity3D]开发视图中的标记 - Gizmos
  8. VNC的安装与配置
  9. 【译】 AWK教程指南 4通过文本内容和对比选择指定的记录
  10. objective-c 加号 减号 - +
  11. 转:PHP 使用ZipArchive压缩文件并下载
  12. HttpClient工具类
  13. Alisha’s Party(队列)
  14. 利用Ihttpmodel实现网站缓存,解决Server.Transfer 直接输出HTML源代码的问题
  15. iOS 错误及解决汇总
  16. GitLab简单使用
  17. ES6-LET,变量提升,函数提升
  18. [No0000C7]windows 10桌面切换快捷键,win10
  19. Oracle 11.2.0.4.0 Dataguard部署和日常维护(5)-Datauard 主备切换和故障转移篇
  20. ==和is

热门文章

  1. 使用JS调用手机本地摄像头或者相册图片识别二维码/条形码
  2. flask --- 02. 路由, 初始化配置,蓝图
  3. sql server 查询某个表被哪些存储过程调用
  4. (转载)Unity UGUI鼠标点击UI不受影响方法IsPointerOverGameObject
  5. Oracle三个配置文件详解
  6. eclipse中如何在当前工程中查找一个字符串
  7. linux使用代理进行apt安装 以 nord 为例
  8. 通过RequestContextHolder直接获取HttpServletRequest对象
  9. pytoch word_language_model 代码阅读
  10. [hdu P4114] Disney's FastPass