Witam
Napisałem taki oto skrypt i mam pytanie dlaczego drugi printFile nic nie wypisuje.
def printFile(name):
"""print file """
for line in name:
print(line, end='')
f = open('workfile.txt', 'r')
print("Print file first time:")
printFile(f)
print("Print file second time:")
printFile(f)
Uruchomienie skryptu daje takie wyjście:
Print file first time:
First line of the file.
Second line of the file.
Print file second time: