A ChatGPT based emulation of the therapist Doctor Kernel from the book "A digital Affair" by Neora Shem Shaul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

genlogs.py 360B

12345678910111213141516
  1. import chevron
  2. from glob import glob
  3. import os
  4. MAX_FILES = 20
  5. def genlog():
  6. os.chdir('logs')
  7. filenames = list(reversed(sorted(glob("*.txt"))))[:MAX_FILES]
  8. with open('../logs.tmpl') as fin:
  9. with open('index.html','w') as fout:
  10. fout.write(chevron.render(fin, {"filenames": filenames}))
  11. if __name__ == '__main__':
  12. genlog()