title: How to create a function to save information in dictionary from a csv file in python
body: <p>I am writing and testing a function for opening a .csv file and save information in a dictionary, instead of using import csv.</p>
  <p>The csv file is like:</p>
  <pre><code>16SAP,12/02/24,sapin-9,MATEYIJDNS
  FAS1,01/02/21,fasiculata,MTYEUSOLD
  EDS5,10/20/20,epsilon,MHGSJDKDLSKDKDJS
  etc....
  </code></pre>
  <p>and .csv file has a (,) separated format and 4 fields: identifier, date, name and sequence, respectively.</p>
  <p>My code is:</p>
  <pre><code>def dicfromcsv(csv_file):
      with open('csv_file', 'r') as f:
          d = {}
          l = f.read().split(',')
          for i in l:
              values = i.split(':')
              d[values[0]] = values[1], values[2], values[3], values[4]
  
  dicfromcsv('PDB.csv')
  
  </code></pre>
  <p>But it doesn't function.</p>
  <p>Thank in advance</p>