Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
短くする必要がある 14 行に問題があります。これらの行は、特定のファイルを開いて読み取ります。単一のループでこれらの各行の close() タグをすでに短縮しましたが、これらの行でそれを行う方法が想像できません。
def read_utf8(filename): with codecs.open(filename, mode="r", encoding="utf8") as f: return f.read() header = read_utf8("static/header")