How do I make it so that python automatically closes open files when the player attempts to quit?
This is what I have so far:
hai = open('hai.txt','a')
quit = 0
while quit == 0:
hai.write('SPAM')
hai.close()
How do I make it so that python automatically closes open files when the player attempts to quit?
This is what I have so far:
hai = open('hai.txt','a')
quit = 0
while quit == 0:
hai.write('SPAM')
hai.close()