F=open("HirarchicalInheritance.py","rb")
data=F.read(20)
print(data.decode())
print("==================")
F.seek(40,1) # 1 current position ..move pointer to 60th position
data=F.read()
print(data.decode())
F.close()
HirarchicalInheritance.py:
F=open("HirarchicalInheritance.py","rb")
data=F.read()
print(data.decode())
F.seek(10,0) # 0 begin of file..Move Pointer to 10th Position
data=F.read()
print(data.decode())
F.seek(-40,2) # 2 end of file
data=F.read()
print(data.decode())
Output:
F=open("HirarchicalInheritance.py","rb")
data=F.read(20)
print(data.decode())
print("==================")
F.seek(40,1) # 1 current position ..move pointer to 60th position
data=F.read()
print(data.decode())
F.close()
Program to illustrate the program
Main.py:
HirarchicalInheritance.py:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer