Spaces:
Runtime error
Runtime error
Update app.py
Browse files1 unmodified line23456789101112131415161718191 unmodified lineimport gradio as gr# 定義抽籤函數def draw_lots(names):names_list = names.split(',')winner = random.choice(names_list)return winner# 建立 Gradio 介面iface = gr.Interface(fn=draw_lots,inputs="text",outputs="text",title="抽籤系統",description="輸入名字列表,以逗號分隔,系統將隨機選出一個名字")# 啟動介面1 unmodified line23456789101112131415161718191 unmodified lineimport gradio as gr# 定義抽籤函數def draw_lots(max_number):max_number = int(max_number)winner = random.randint(1, max_number)return f"中獎號碼是: {winner}"# 建立 Gradio 介面iface = gr.Interface(fn=draw_lots,inputs=gr.inputs.Number(label="輸入全班的號碼上限"),outputs="text",title="抽籤系統",description="輸入全班的號碼上限,系統將隨機選出一個號碼")# 啟動介面
app.py+6-6