#!/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_button = gr.Button("更新", visible=False) update_button.click(fn=update_content, inputs=[], outputs=[output]) gr.HTML(""" """) demo.launch()