Skip to content

Instantly share code, notes, and snippets.

@ak1211
Created March 2, 2016 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ak1211/3a9db551575074f88595 to your computer and use it in GitHub Desktop.
Save ak1211/3a9db551575074f88595 to your computer and use it in GitHub Desktop.
これHTMLのひな形にデータを入れている
buf = []
for num, item in enumerate (start_session_logs):
st = item
tm = item["terminate log"]
text = "[ '{0}', '{1}'".format (1+num, st["User"])
text = text + ", new Date({0})".format (st["DateTime"].strftime ('%Y, %m, %d, %H, %M, %S'))
if tm:
text = text + ", new Date({0})".format (tm["DateTime"].strftime ('%Y, %m, %d, %H, %M, %S'))
text = text + "],"
buf.append (text)
buf[-1] = buf[-1].rstrip(',')
#print start_and_term_relationship
datarows = "\n ".join (buf)
print html.format(datarows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment