SyntaxFix
Write A Post
Hire A Developer
Questions
from __future__ import with_statement with open('file.txt','r+') as f: counter = str(int(f.read().strip())+1) f.seek(0) f.write(counter)