What I'm trying to do is make a highscore system for a game I made (see one of my prev. posts). What it does is reads the file when it starts and saves when the program is shut down, but I found it really tricky because using
[CODE=python]
info = file("___.txt")
info.seek(0)
info.write(str( highscore))
[/CODE]
is very uneffective. This is because it just moves the text instead of writing over it.
Is it possable to make a huge string and just tell the file that's what it will now be, or how about removeing all the files strings so I can write in the new highscores?
OH! How about saving directly to the .py file, is that possable? If so, would it still work if I turned it into a .exe file?
[CODE=python]
info = file("___.txt")
info.seek(0)
info.write(str( highscore))
[/CODE]
is very uneffective. This is because it just moves the text instead of writing over it.
Is it possable to make a huge string and just tell the file that's what it will now be, or how about removeing all the files strings so I can write in the new highscores?
OH! How about saving directly to the .py file, is that possable? If so, would it still work if I turned it into a .exe file?
Comment