Random accesss file : Seek : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Seek »

 

Random accesss file


f = open(r'c:textsomefile.txt', 'w')
f.write('01234567890123456789')
f.seek(5)
f.write('Hello, World!')
f.close()
f = open(r'c:textsomefile.txt')
print f.read()
f = open(r'c:textsomefile.txt')
print f.read(3)
print f.read(2)
print f.tell()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo File
» Seek