Py.Cafe

mariobuikhuizen/

panel-dynamic-greeting

Dynamic Greeting Interface

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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()