Instant File I/O

jam1991 jordanmeyer1991 at gmail.com
Thu Mar 24 00:53:42 EDT 2011


I'm trying to build a feature on to a text-based game that I've been
working on that would allow users to view their stats. Information is
stored in a flat text database file that is given the same name that
they sign into the program with; however, this information doesn't
appear in the file until after the program has closed. This poses a
problem for retrieving the up-to-date statistics data during the same
session. Is there anyway I can fix this? I'm using .write() to write
text to the file and the linecache module to retrieve it. Running
linecache.clearcache() at the beginning of the stat function doesn't
seem to do the trick. Any help would be greatly appreciated!



More information about the Python-list mailing list