title: Is there a function that will allow me to store a specific list(or header) from a csv file in a variable?
body: <pre><code>def main():
  
      # TODO: Check for command-line usage
      if len(sys.argv) != 3:
          print(&quot;Usage : python dna.py (DNA) (SEQUENCE)&quot;)
          exit (1)
  
      file = open(sys.argv[2], &quot;r&quot;)
      system = file.read()
      csvfile = open(sys.argv[1], &quot;r&quot;)
      truecsv = csv.reader(csvfile)
      dictreader = csv.DictReader(csvfile)  #in case I need this
      copydict_ = dictreader
      header = next(truecsv)
      matches = {}
      for i in header[1:len(header)]:
          number = longest_match(system, i)
          match = {i : longest_match(system, i)}
          matches.update(match)
      print(matches)
  </code></pre>
  <p>I store the header in a header variable using the next function, but that messes up with the dictionary that is created later by dictreader, which is not ideal as I want to try and MATCH my dict matches with the file. I want to know how I can store the header without using the next function.</p>