File size: 358 Bytes
ec6b931
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# archivo mi_app.py
import gradio as gr

def euros_a_dolares(euros):
    return f"{float(euros)*1.07:.2f} USD"

demo = gr.Interface(
    fn=euros_a_dolares,
    inputs=gr.Number(label="Euros"),
    outputs=gr.Textbox(label="Dólares"),
    title="Conversor rápido",
)

if __name__ == "__main__":
    demo.launch()       # por defecto lanza en 127.0.0.1:7860