old_contents: #! python3
  # P3_removeCsvHeader.py - Removes the header from all CSV files in the current
  # working directory.
  
  import csv, os
  
  os.makedirs('headerRemoved', exist_ok=True)
  
  # Loop through every file in the current working directory.
  for csvFilename in os.listdir('.'):
      if not csvFilename.endswith(".csv"):
          continue  # skip non-csv files
  
      print("Removing header from " + csvFilename + "...")
  
      # Read the CSV file in (skipping first row).
      csvRows = []
      csvFileObj = open(csvFilename)
      readerObj = csv.reader(csvFileObj)
      for row in readerObj:
          if readerObj.line_num == 1:
              continue  # skip first row
          csvRows.append(row)
      csvFileObj.close()
  
      # Write out the CSV file.
      csvFileObj = open(os.path.join('headerRemoved', csvFilename), 'w', newline='')
      csvWriter = csv.writer(csvFileObj)
      for row in csvRows:
          csvWriter.writerow(row)
      csvFileObj.close()
  
new_contents: #! python3
  """Remove CSV header
  
  Removes the header from all CSV files in the current working directory.
  
  Note:
      Outputs to ``./headerRemoved`` directory.
  
  """
  
  
  def main():
      import csv, os
  
      os.makedirs('headerRemoved', exist_ok=True)
  
      # Loop through every file in the current working directory.
      for csvFilename in os.listdir('.'):
          if not csvFilename.endswith(".csv"):
              continue  # skip non-csv files
  
          print("Removing header from " + csvFilename + "...")
  
          # Read the CSV file in (skipping first row).
          csvRows = []
          csvFileObj = open(csvFilename)
          readerObj = csv.reader(csvFileObj)
          for row in readerObj:
              if readerObj.line_num == 1:
                  continue  # skip first row
              csvRows.append(row)
          csvFileObj.close()
  
          # Write out the CSV file.
          csvFileObj = open(os.path.join('headerRemoved', csvFilename), 'w', newline='')
          csvWriter = csv.writer(csvFileObj)
          for row in csvRows:
              csvWriter.writerow(row)
          csvFileObj.close()
  
  
  if __name__ == '__main__':
      main()
  
subject: Update P3_removeCsvHeader.py added docstring and wrapped in main function