From e50145eaf491f61a2ab3604f5b413a8b5e316602 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 28 Dec 2017 12:47:19 +0100 Subject: Import canonicalization module from ITAP Code by Kelly Rivers found at https://github.com/krivers/ITAP-django. --- canonicalize/tools.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 canonicalize/tools.py (limited to 'canonicalize/tools.py') diff --git a/canonicalize/tools.py b/canonicalize/tools.py new file mode 100644 index 0000000..1df653a --- /dev/null +++ b/canonicalize/tools.py @@ -0,0 +1,15 @@ +"""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() -- cgit v1.2.1