Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Make a program that ,take's time logs in python
- #first start of by making a .txt file with a name , for example , example.txt , then here is the source code
- def logs():
- import datetime
- current_time = datetime.datetime.now()
- current_time = str(current_time)
- logs = open('example.txt', 'a')
- # here you can write your message
- logs.write('\n----------------------------')
- logs.write('\n ran at ')
- # Dont change this line below
- logs.write(current_time)
- logs.write('\n----------------------------\n')
- logs()
Advertisement
Add Comment
Please, Sign In to add comment