title: Python discord bot has problems writing to textfiles
body: <p>I'm currently working on a little discord bot. To host it for free, I'm using an application on <a href="https://www.heroku.com/" rel="nofollow noreferrer">heroku.com</a> which is connected to my github. Everytime I restart the bot it gets some previously stored information from a textfile (<strong>works perfectly</strong>).</p>
  <pre><code>f = open(&quot;example_textfile.txt&quot;, &quot;r&quot;)
  example_list = dict(json.loads(f.read()))
  f.close()
  </code></pre>
  <p>Everytime a list gets updated it should overwrite the textfile with the updated list like this (<strong>does NOT work</strong>):</p>
  <pre><code>f = open(&quot;example_textfile.txt&quot;, &quot;w&quot;)
  f.write(json.dumps(example_list))
  f.close()
  </code></pre>
  <p>If I host the bot locally on my PC everything works perfectly (then I need the path, not just the name of the file). But when I host it with Heroku it can only read the files but not overwrite them. Does anyone know why this doesn't work? Or is there any alternative? Would be great if you could help me :D (And sorry for my bad english xD. I'm not native)</p>