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