title: How to create a dictionary with columns given as keys and values
body: <p>Ok so I am given two columns</p>
  
  <pre><code>A S
  
  A T
  
  A Z
  
  B F
  
  B G
  
  B P
  
  B U
  
  C D
  
  C P
  
  C R
  
  D M
  
  E H
  
  F S
  
  H U
  </code></pre>
  
  <p>The 1st column is a list of points, and the second column is the list of the neighbors of the points. I would like to make it a dictionary so that
  {A:'S','T','Z', B:'F','G','P' etc} and so on.</p>
  
  <p>What I have tried doing is this, given that the text file is the two columns.</p>
  
  <pre><code>edges = open('romEdges.txt')
  
  edgeslist = edges.read().split()
  
  edgeskeys = edgeslist[::2]
  
  edgesvalues = edgeslist[1::2]
  
  
  dictionary = {}
  
  for items in edgeskeys:
  
      dictionary[items]=[]
  
  dictionary = OrderedDict(sorted(dictionary.items(), key=lambda t: t[0]))
  
  for items in edgeskeys:
  
      if edgeskeys[items]==dictionary[items]:
  
          print()
  
  print(dictionary)
  </code></pre>
  
  <p>I have tried making 2 lists, 1 of keys and 1 of values, and tried comparing them to the dictionary, etc, and I just can't get it right!</p>
  
  <p>THERE HAS to be a simple way.</p>
  
  <p>Please help.</p>