黑马程序员技术交流社区

标题: Python JSON+excel数据文件处理 [打印本页]

作者: 专注的一批    时间: 2020-3-3 15:37
标题: Python JSON+excel数据文件处理
1、JSON

import json

def json_basic():

data={

‘’ID’’:1

’’课程‘’:‘’python精讲‘’,

‘’机构‘’:‘’优品课堂‘’,

’‘单价’‘:98.00

’‘网址’‘:’‘http://cord.cn’’

}

print(‘原始数据’)外汇代理http://www.fx61.com/ib.html

print(data)

print(‘-‘*20)

json_str=json.dumps(data)

print(json_str)

print(‘-‘*20)

json_data=json.loads(json_str)

print(json_data)

def json_writer_file():

def json_read_file():

def json_type.diff():

if__name__=‘__main__’:

json.basic()

2、excel

import xlrd

def xl_read():

‘’’’’’excel读取’’’’’’

book=sled.open_workbook(‘product.xls’)

for sheet in book.sheets():

print(sheet.name)

def xl_read_data():

if __name__=‘__main__’:

xl_read_data()





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2