Spaces:
Build error
Build error
Moibe
commited on
Commit
·
372a6ba
1
Parent(s):
79fbb5a
Fix file creation
Browse files
app.py
CHANGED
|
@@ -4,6 +4,16 @@ import time
|
|
| 4 |
import os
|
| 5 |
import pathlib
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
def greet(input1, input2):
|
| 8 |
|
| 9 |
modo = "video"
|
|
@@ -23,11 +33,11 @@ def greet(input1, input2):
|
|
| 23 |
path_video = input2
|
| 24 |
|
| 25 |
#Mientras tanto voy a crear un archivo de texto genérico.
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
path_archivo = pathlib.Path("hola.txt")
|
| 30 |
|
|
|
|
|
|
|
| 31 |
print("El path de mi archivo de texto es: ", path_archivo)
|
| 32 |
|
| 33 |
if plataforma == "local":
|
|
|
|
| 4 |
import os
|
| 5 |
import pathlib
|
| 6 |
|
| 7 |
+
def create_text_file(filename, text):
|
| 8 |
+
|
| 9 |
+
with open(filename, "w") as f:
|
| 10 |
+
f.write(text)
|
| 11 |
+
|
| 12 |
+
path_archivo = pathlib.Path(filename)
|
| 13 |
+
|
| 14 |
+
return path_archivo
|
| 15 |
+
|
| 16 |
+
|
| 17 |
def greet(input1, input2):
|
| 18 |
|
| 19 |
modo = "video"
|
|
|
|
| 33 |
path_video = input2
|
| 34 |
|
| 35 |
#Mientras tanto voy a crear un archivo de texto genérico.
|
| 36 |
+
filename = "hola.txt"
|
| 37 |
+
text = "Hola Mundo"
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+
path_archivo = create_text_file(filename, text)
|
| 40 |
+
|
| 41 |
print("El path de mi archivo de texto es: ", path_archivo)
|
| 42 |
|
| 43 |
if plataforma == "local":
|