Just to be quick: I'm new to python and I'm still learning
Now to the problem: I want to log a variable and then later use it.
This is my code:
import logging
LOG_FILENAME = "users.log"
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
newname = input("Name: ")
logging.info("Username:")
logging.info(newname)
newpwd = input("Password: ")
logging.info("Password:")
logging.info(newpwd)
In my log(users.log) file it says:
(PS: I used carrot in the name input and potato as the password input)
INFO:root:Username:
INFO:root:carrot
INFO:root:Password:
INFO:root:potato
So later in the code, is there any way that I could use the variables that I created and saved to the log file?