Spaces:
Sleeping
Sleeping
Upload 2 files
Browse filesFiles changed (2)
- app.pyAdded+23
- requirements.txtAdded
1234567891011121314151617181920212223import gradio as grimport pandas as pdimport random
def random_excel_viewer(excel_file): df = pd.read_excel(excel_file.name) column_name = df.columns[0] random_entry = random.choice(df[column_name]) return f"被随机的幸运观众:\n{random_entry}"
iface = gr.Interface( fn=random_excel_viewer, inputs="file", outputs="text", layout="vertical", title="课堂开心点名器", description="随机抽取一名幸运观众。")
iface.launch()
# 运行主循环root.mainloop()app.pyAdded+23
requirements.txtAdded