Professional Documents
Culture Documents
F2 = open("File1.txt", 'r')
Str1 = F2.read(4)
Str2 = F2.read(5)
print(Str1 + '| |' + Str2)
Str3 = F2.read()
Str4 = F2.read()
print(Str3)
print(Str4) # Empty String, reading
cursor in end of the file
F2.close()
F1 = open("File1.txt",'r')
print(F1.readlines()) # Output: List (of
each line)
F1.close()
print(open("file1.txt").read())
Python course