#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import gradio as gr
import datetime
def update_content():
current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
return f"Update: {current_time}"
with gr.Blocks() as demo:
gr.HTML("""
Update Example
press here to update
""")
output = gr.Textbox(label="Update the content")
update_button = gr.Button("UUpdate", visible=False)
update_button.click(fn=update_content, inputs=[], outputs=[output])
gr.HTML("""
""")
demo.launch()