title: How can i import a function to other file?
body: <p>I am trying to use a function from one file in another one so i dont need to be repeating the code.</p>
  
  <p><strong><em><code>file.py</code></em></strong></p>
  
  <pre class="lang-py prettyprint-override"><code>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)
  </code></pre>
  
  <p>i want to use the <code>getDealayedCSV()</code> and <code>getDeletedCSV()</code> in another file since i want the result of these 2 functions.</p>