How to read two packed lists from binary file in Python

1 Answer

0 votes
import pickle

fh = open("d:\data.pkl", "rb")
(lang_1, lang_2) = pickle.load(fh)
fh.close()
print(lang_1)
print(lang_2)


'''
run:

['python', 'c', 'c++', 'c#', 'java']
['php', 'html', 'css', 'javascript']

'''

 



answered Dec 22, 2017 by avibootz

Related questions

1 answer 203 views
1 answer 254 views
1 answer 185 views
1 answer 264 views
1 answer 206 views
206 views asked Nov 16, 2018 by avibootz
1 answer 189 views
...