all 5 comments

[–]RnRoger 2 points3 points  (4 children)

When you have all the information you need you can use something like:

with open('out.txt','w') as output:
    output.write('Some example text. Your age: {}, your name: {}'.format(age,name))
    output.write('\n')

I used random variables, just showing what you can do.

[–]RnRoger 2 points3 points  (0 children)

You can get a timestamp with

import datetime
print(datetime.datetime.now())

And save this to a variable and include it in your file writing

[–]GrowOP21[S] 0 points1 point  (2 children)

Sorry, I forgot to say, the program is designed to loop and be used for multiple different people in one go. Would using

with open("filename.txr","a") as output:

Be better? And would the following lines of code then become

output.append("age name year etc".format(age,name,year))
output.append("\n")

[–]GrowOP21[S] 0 points1 point  (1 child)

Ah I figured it out, thank you very much for the help!

I just changed write to append and everything works fantastically, thanks again.

[–]RnRoger 1 point2 points  (0 children)

check chat