title: I have a piece of code with the output of dictionaries in a text file, and I had a question whether it can be done with the shelve module?
body: <p>I have this piece of code</p>
  <pre><code>dict3 = {'12345': ['paper', '3'], '67890': ['pen', '78'], '11223': ['olive', '100'], '33344': ['book', 
  '18']}
  
  output = open(&quot;output.txt&quot;, &quot;a&quot;, encoding='utf-8')
  for k, v in dict3.items():
     output.writelines(f'{k} {v[0]} {v[1]}\n') 
  output.close()
  </code></pre>
  <p>When this code is executed I have this result:</p>
  <p>12345 paper 3</p>
  <p>67890 pen 78</p>
  <p>11223 olive 100</p>
  <p>33344 book 18</p>
  <p>So, maybe someone knows how to do the same, but using the shelve module?</p>