A ChatGPT based emulation of the therapist Doctor Kernel from the book "A digital Affair" by Neora Shem Shaul
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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()