import dominate
from dominate.tags import *
doc = dominate.document(title='Cell Value report')
with doc:
with div():
attr(cls='body')
h2('Values Missing in the files.....')
with div(id='header').add(ol()):
for i in unique_file:
li(i.title())
これを試して、Python出力をHTMLで生成しました。
でパスをハードコーディングすると、HTML 部分は正常に動作しますが、os.listdir
パスを入力として使用するとエラーが表示されます。
search_path = input("Enter directory path to search: ")#directory path
for fname in os.listdir(path=search_path):
これはエラーです
TypeError: listdir: path should be string, bytes, os.PathLike or None, not input_
Pythonにあるライブラリyattagも試しましたが、ループして HTML のリストとして出力する必要があります。yattagで試しましたが、達成できません。何が間違っていたのかわかりません。出力を達成するために使用する必要がある他のライブラリはありますか。いくつかの提案をお願いします。List[]