0
reading file issue
file = open ('G:\\first.txt','r') print(file.read()) strn = file.read() print(strn) #This line gives '0' output file.close()
3 odpowiedzi
+ 1
file.read() exhausts the file iterator, meaning there is nothing left after the first pass of read. Thus you have nothing in strn.
0
Delete the second line. It's useless.
0
yes I understood