I am a complete beginner using python and I been asked to log the profile for every time I run a given a simulation. My simulation has 4 classes and 10 methods that run in a loop until aa certain condition is achieved.
I have written the follow file that creates the file:
LOG_FILE = open(os.path.join(os.getcwd(), "logs", "Log_Log_{}.txt".format(
str(datetime.datetime.now()).replace(":", "_"))), mode="w")
Right at the bottom of the script I added:
if __name__ == "__main__":
cProfile.run("main()", LOG_FILE, sort="tottime")
Why is my Log_Log file blank and cProfile not returning anything?