import panel as pn
import hashlib
pn.extension(template="fast")
widget = pn.widgets.TextInput(value="world")
def sha256_of_file(file_path):
sha256_hash = hashlib.sha256()
# Open the file in binary mode and read chunks
with open(file_path, "rb") as f:
for byte_block in iter(lambda: f.read(4096), b""):
sha256_hash.update(byte_block)
return sha256_hash.hexdigest()
def hello_world(text):
print("start digest")
print(sha256_of_file("Scraped_dataset.csv"))
return f"Hello {text}!"
pn.Row(widget, pn.bind(hello_world, widget)).servable()