I am trying to use a function from one file in another one so i dont need to be repeating the code.
file.py
def getTrain(data):
trainList = []
for list in data:
for train in list['HorarioDetalhe']:
trainDict = {}
trainDict['id'] = train['ID']
trainDict['origin'] = train['EstacaoOrigem']['Nome']
trainDict['destiny'] = train['EstacaoDestino']['Nome']
trainDict['operator'] = train['Operador']['Nome']
trainDict['status'] = train['EstadoComboio']['Nome']
trainDict['arrivalTime'] = train['HoraChegada']
trainList.append(trainDict)
getDelayedCSV(trainList)
getDeletedCSV(trainList)
i want to use the getDealayedCSV()
and getDeletedCSV()
in another file since i want the result of these 2 functions.