You would open the code with
from sys import argv
script, filename = argv
target = open(filename, 'w')
then assign each piece of info to a variable with an appropriate name
time = #x
score = #x
user = #name
then type the following
target.write(time)
target.write("
")
target.write(score)
target.write("
")
target.write(user)
target.write("
")
target.close()
when you run the file you would run it with an argument, that argument being the file where you would like to write the info.
>python mymemorygame.py savegamefile.txt
You may also want to consider truncating the file, before writing to it depending on how you are saving the info (multiple files or one file)
I hope this helps, apologies if it doesn't I may have misunderstood what it is you are looking to do.
alternatively, it may be harder to write but easier to manage/implement, you could put the info in to a list that you store in a single file, rather than writing new .txt files all the time.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…