Spaces:
Running
Running
Moibe
commited on
Commit
·
8ea28ad
1
Parent(s):
faa2cc3
Autoplay at hola
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ def greet(input1, input2):
|
|
| 29 |
print("source_path: ", source_path)
|
| 30 |
print("target_path: ", target_path)
|
| 31 |
|
| 32 |
-
command = "python hola.py -t
|
| 33 |
print(command)
|
| 34 |
time.sleep(1)
|
| 35 |
proc = os.popen(command)
|
|
|
|
| 29 |
print("source_path: ", source_path)
|
| 30 |
print("target_path: ", target_path)
|
| 31 |
|
| 32 |
+
command = "python hola.py -t source_path"
|
| 33 |
print(command)
|
| 34 |
time.sleep(1)
|
| 35 |
proc = os.popen(command)
|
hola.py
CHANGED
|
@@ -1,15 +1,22 @@
|
|
| 1 |
import argparse
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
parser
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
|
| 10 |
|
| 11 |
-
print("
|
| 12 |
-
print("El target path recibido es: ", args.target_path)
|
| 13 |
|
| 14 |
-
|
| 15 |
-
print("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import argparse
|
| 2 |
|
| 3 |
+
def func_hola():
|
| 4 |
|
| 5 |
+
parser = argparse.ArgumentParser()
|
| 6 |
|
| 7 |
+
parser.add_argument('-t', '--target_path', help='Ruta al archivo de destino')
|
| 8 |
|
| 9 |
+
args = parser.parse_args()
|
| 10 |
|
| 11 |
+
print("Esto es args: ", args)
|
|
|
|
| 12 |
|
| 13 |
+
print("Hola desde Hola.py el día de hoy:")
|
| 14 |
+
print("El target path recibido es: ", args.target_path)
|
| 15 |
+
|
| 16 |
+
nueva_var = args.target_path
|
| 17 |
+
print("La nueva var es: ", nueva_var)
|
| 18 |
+
|
| 19 |
+
return nueva_var
|
| 20 |
+
|
| 21 |
+
if __name__ == "__main__":
|
| 22 |
+
func_hola()
|