Spaces:
Sleeping
Sleeping
JM: try to get output into file
Browse files
app.py
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
def salut(nom):
|
| 4 |
-
with open(
|
|
|
|
|
|
|
|
|
|
| 5 |
file.write(f"Nom: {nom}\n")
|
| 6 |
-
|
| 7 |
-
|
| 8 |
|
| 9 |
demo = gr.Interface(fn=salut, inputs="text", outputs="text")
|
| 10 |
demo.launch(share=True)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import subprocess
|
| 3 |
|
| 4 |
def salut(nom):
|
| 5 |
+
with open("data.txt", "w") as file:
|
| 6 |
+
p = subprocess.run(["pwd"], capture_output=True)
|
| 7 |
+
file.write(str(p.stdout))
|
| 8 |
+
print(str(p.stdout))
|
| 9 |
file.write(f"Nom: {nom}\n")
|
| 10 |
+
|
| 11 |
+
return "Salut " + nom
|
| 12 |
|
| 13 |
demo = gr.Interface(fn=salut, inputs="text", outputs="text")
|
| 14 |
demo.launch(share=True)
|