title: Use variables of one function to another function in python
body: <p>I have a function:</p>
  
  <pre><code>def main():
      bla bla bla...
      output_name = 'Employee'
      bla bla bla...
  </code></pre>
  
  <p>I have another function:</p>
  
  <pre><code>def tocsv(path):
  xls_file = pd.ExcelFile(path)
  
  names = xls_file.sheet_names    
  
  for items in names:     
      df = xls_file.parse(items)
      out_file = output_name + '.csv'
      df.to_csv(out_file, sep='\t',index=False,header=False, quoting=csv.QUOTE_NONE )
  </code></pre>
  
  <p>I need the name of the file from the variable 'output_name' defined in the first function main(). So that my output file will be named as "Employee.csv" . How can I do it? Thanks in advance   </p>