MCPcopy Create free account
hub / github.com/geekcomputers/Python / binary_read

Function binary_read

file_handle/File handle binary/read.py:4–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3
4def binary_read():
5 with open("studrec.dat", "rb") as b:
6 stud = pickle.load(b)
7 print(stud)
8
9 # prints the whole record in nested list format
10 print("contents of binary file")
11
12 for ch in stud:
13 print(ch) # prints one of the chosen rec in list
14
15 rno = ch[0]
16 rname = ch[1] # due to unpacking the val not printed in list format
17 rmark = ch[2]
18
19 print(rno, rname, rmark, end="\t")
20
21
22binary_read()

Callers 1

read.pyFile · 0.70

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected