Commit db067e56 by Juan Pablo dure

migro a subproceso

1 parent f4670ac4
from datetime import datetime from datetime import datetime
from time import sleep from time import sleep
import os import os, subprocess
from configuracion import * from configuracion import *
import pandas as pd import pandas as pd
...@@ -69,12 +69,15 @@ class FosaDiaria(): ...@@ -69,12 +69,15 @@ class FosaDiaria():
def _BuscarExcelDescargado(self,tmp): def _BuscarExcelDescargado(self,tmp):
rta = False rta = False
cmd = f"""ls {self.CarpetaDescarga} -ls |grep {self.cabezaera}| grep xls | grep -v crdownload &>{tmp}""" cmd = f"""ls {self.CarpetaDescarga} -ls |grep {self.cabezaera}| grep xls | grep -v crdownload""".split(" ")
os.system(cmd) rte = subprocess.check_output(cmd)
#os.system(cmd)
print(cmd) print(cmd)
sleep(0.1) print(rte)
file1 = open(tmp, 'r') Lines = str(rte).split("\n")
Lines = file1.readlines() #sleep(0.1)
#file1 = open(tmp, 'r')
#Lines = file1.readlines()
for line in Lines: for line in Lines:
der = str(line).split(" ") der = str(line).split(" ")
#print(1,type(line),type(der)) #print(1,type(line),type(der))
...@@ -83,7 +86,7 @@ class FosaDiaria(): ...@@ -83,7 +86,7 @@ class FosaDiaria():
#print(3,line,der,der[-1],archivo) #print(3,line,der,der[-1],archivo)
print(archivo) print(archivo)
rta = archivo rta = archivo
file1.close() #file1.close()
os.system(f"""rm {tmp}""") os.system(f"""rm {tmp}""")
return rta return rta
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!