title: concatenate multiple xlsx files multiprocessing python
body: <p>What i'm trying to do is to concatenate multiple xlsx files that are in a specific folder, using the multiprocessing library.</p>
  <p>So for instance if i have the files A,B,C in the folder, i want to concatenate so i have A,B,C in a single file.</p>
  <p>the code that i have right now is this:</p>
  <pre><code>import pandas as pd
  
  def Filenames():
      location = os.getcwd() # get current working directory ( the directory that the pyhton file is saved
      filenames = glob.glob(location + '\*.xlsx') # search for every file that has xlsx extension. Creates a list of these filenames
      return filenames
  
  
  def Filename_Compare(file,df1):
      location = os.getcwd()
      filename_compare = GetFilename(location,file)
              # for each file, open it and concatenate with the previous data frame
      if filename_compare == 'Standard Tracker':
          pass
      else:
          try:
              df2 = pd.read_excel(file,sheet_name='Export',dtype=str) 
              df1 = pd.concat([df1,df2],ignore_index=True)
          except ValueError:
              if filename_compare == 'DuplicateSearch' :
                  pass
              elif filename_compare == 'Concatenate':
                  pass
              else:
                  messagebox.showinfo(&quot;Error&quot;,&quot;Please check if the file: [{}] is a LL file and if it has a Export tab&quot;.format(filename_compare))
      return df1
  
  
  def Generate_Concatenate(dataframe):
      writer_concatenate = pd.ExcelWriter('Concatenate.xlsx',engine='xlsxwriter')
      dataframe.to_excel(writer_concatenate,sheet_name='Export')
      writer_concatenate.save()
  
  
  df1 = pd.DataFrame()
      
  for file in list_of_files:
      df1 = Filename_Compare(file,df1)
                  
  Generate_Concatenate(df1)
  </code></pre>
  <p>I'm stuck on how can i pass the previous dataframe and the current file, using multiprocessing (so i speed up the time of the task).</p>
  <p>can someone help me?</p>
  <p>thanks</p>