I want to apologize for sucking at coding before I begin.
So I store ONLY integers in the first line of a text file in python. And I want a function to add +1 to the integer in the text file.
def addone():
with open("data/"+str(messager)+".txt", "r+") as f:
dataint = f.readline()
This is my unfinished code of the function. Right now dataint = 1, but it's a string.
How do I make it so that it adds +1 to dataint
and prints the value every time this function is called?