title: python: create dictionary from lines of txt file
body: <p>Very new to this, appreciate your patience. </p>
  
  <p>I have a txt file of a poem. Ultimately I want create a dictionary such that my key is the line# and the value is the text on that line. For instance, if my poem is this: </p>
  
  <p>Roses are red,</p>
  
  <p>Violets are blue.</p>
  
  <p>I would like my dictionary to be:</p>
  
  <pre><code>dictionary = {1: 'Roses are red', 2: 'Violets are blue'} 
  </code></pre>
  
  <p>Ultimately I want my program to allow me to search for a line of the poem by entering the line number (the key). </p>
  
  <p>I've started off by doing this-- </p>
  
  <pre><code>def getFile():
      prose = str(input('Please enter the file path for your text file: '))
  
      dictionary = {}
  
      infile = open(prose, 'r')
      for line in infile:
          dictionary[line] += 1
          print(dictionary)
      infile.close()
  
  getFile()
  </code></pre>
  
  <p>But I'm lost and don't know what to do next. I've tried looking this up, I'm not understanding this. Any help would be much appreciated. </p>