#json是一种通用的数据类型,所有的语言都认识
#json是一个字符串,json串里面都得是双引号,主要是这四个函数
#dump
#dumps
#load
#loads
import json
names = {
"name":"王俊熹",
"age":36,
"assfdf":223,
"sdfsdf":23232323,
"sdfsdf1":23232323
}
# f = open('wjx.jmy','w',encoding='utf-8')
# res = json.dumps(names,ensure_ascii=False) #把字典转成json串
# names_json='{"assfdf": 223, "age": 36, "sdfsdf1": 23232323, "name": "王俊熹", "sdfsdf": 23232323}'
# names = json.loads(names_json)
# print(type(names))
# print(names)
# print(type(res))
# f.write(res)
res= open('wjx.json',encoding='utf-8')
name_dic = json.load(res) #传一个文件对象,自动转成字典,他会自己读文件,不用咱们再读一次
# print(type(name_dic))
# print(name_dic)
# fw=open('zdd.json','w',encoding='utf-8')
# json.dump(names,fw,ensure_ascii=False,indent=10)#写文件里面的时候,indent几个缩进 print(json.dumps(names,indent=10))

最新文章

  1. 封装tip控件
  2. 关于mysqli_fetch_assoc的一点说明
  3. JButton计数
  4. php 循环向<select>添加选项
  5. Google 镜像站大集合
  6. 两行代码搞定UITableView无数据无网络显示-b
  7. WPF中将DataGrid导出Excel
  8. SOA,ESB 与 SCA
  9. office web apps server 问题和解决办法
  10. OpenCV学习1-----打开摄像头并在画面上添加水印
  11. bzoj 2555: SubString
  12. Objective-C 是如何慢慢走红的?
  13. call,apply,bind——js权威指南函数属性和方法章节读书笔记
  14. 前端开发工具icestar
  15. 第三百五十节,Python分布式爬虫打造搜索引擎Scrapy精讲—selenium模块是一个python操作浏览器软件的一个模块,可以实现js动态网页请求
  16. Centralized Cache Management in HDFS
  17. C# 获取物理网卡Mac地址
  18. 线程间的通信方式3--Handler
  19. multi-mechanize error: can not find test script: v_user.py问题
  20. Redis-Linux安装

热门文章

  1. CentOS7 安装 Node.js
  2. js 判断 IE 浏览器
  3. jquery get ($.get) 事件用法与分析
  4. IEnumerable, IEnumerator接口
  5. Unity3d 中文菜单
  6. Java学习笔记——java介绍
  7. how to add them, how to multiply them
  8. threading.local的作用?
  9. python cookbook第三版学习笔记十八:可由用户修改的装饰器
  10. Windows平台下搭建Git服务器的图文教程(转发)