write a python script to read the data from binary file "players.dat" having information [code, name, total runs and country]
Answers
Answered by
3
Answer:
Python
Porgram:
import pickle
file=open('players.dat','rb')
read=pickle.load(f)
for data_list in read:
print(data_list)
file.close()
Explanations:
- pickle module performs functions on binary file.
- load method is used to get the file data into a reader object which can be further read with a loop.
- close() function closes the file after performing the function.
Similar questions
History,
3 months ago
Math,
3 months ago
Chemistry,
3 months ago
English,
6 months ago
Social Sciences,
11 months ago