title: How to populate the python dictionary object that support multi line values for dictionary keys
body: <p>I am using python and reading from &quot;.txt&quot; file and populating  python dictionary in &quot;Key: value&quot; pair as shown below.</p>
  <p>Content of sample file is shown below:</p>
  <pre><code>product: osName
  customers: verizon    
  class: CL1
  file_location: /opt/test.txt
  Remarks: This is multi line data. This is line - 1 of remarks field. 
  This is line - 2 of remarks field. 
  This is line - 3 of remarks field. 
  category: software
  </code></pre>
  <p>My code to read from the file and populate the python dictionary is shown below:</p>
  <pre><code>with open(txt_file) as f:
    for l in f:
      key_value = l.strip().split(':',1) 
      txtdict[key_value[0].strip()] = key_value[1].strip()
        
  </code></pre>
  <p>Above solution works fine as long as keys and it's values are in one line only.</p>
  <p>Wondering how can I populate the python dictionary object that can support multi line values for any given key?</p>
  <p>Thanks for the answer. Wondering why this question is marked as not focused question.</p>