"""This is a file of useful functions used throughout the hint generation program""" import time, os.path, ast, json def log(msg, filename="main", newline=True): return txt = "" if newline: t = time.strftime("%d %b %Y %H:%M:%S") txt += t + "\t" txt += msg if newline: txt += "\n" f = open('log/' + filename + ".log", "a") f.write(txt) f.close()