Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Created on Tue Apr 24 12:40:09 2018
- @author: student
- """
- import pickle
- """
- file = open("../data/inf.txt").read().split("\n")
- nums = []
- fields = file[0].split("|")
- del file[0]
- i = 0
- for line in file:
- file[i] = line.split("|")
- nums.append(file[i][0])
- i+=1
- data = dict(zip(nums, (dict(zip(fields,x)) for x in file)))
- #obj = {"one": 123, "two": [1, 2, 3]}
- output = open('data.pkl', 'wb')
- pickle.dump(data, output, 2)
- output.close()
- """
- input_file = open('../data/data.pkl', 'rb')
- data2 = pickle.load(input_file)
- print(data2)
- input_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement