title: Splitting lines read from file into dictionary key-value pairs
body: <p>I have a file in the following format:</p>
  
  <pre><code>key1/value1
  key2/value2
  key3/value3
  ...
  </code></pre>
  
  <p>I want to read it into a dictionary. I have written a following code which accomplishes this:</p>
  
  <pre><code> with open(filename, 'r') as dir_file:
      return {line.split('/')[0]: line.split('/')[1] for line in dir_file.readlines()}
  </code></pre>
  
  <p>However, it seems to me that invoking <code>split()</code> method twice is a bad code, and there must be a simpler/better way to split the line into a key-value pair that I'm missing here. </p>
  
  <p>Thank you in advance!</p>