import json book = '?C:\Users\wt271\Desktop\jc\passenger.txt' book_list = [] with open(book) as b: book_list = b.read().splitlines() data = dict(zip(book_list)) print type(data) print data j = json.dumps(data) print type(j) print j
相关分类