title: How to permanently store the same text as a "variable" in a text file using Python
body: <p>So I'm making a config file with the contents of variables. I made this variable for an example:</p>
  <pre><code>spawnme=true
  </code></pre>
  <p>And here is my Python program:</p>
  <pre><code>with open('myconfig.txt', 'w') as f:
      f.write(&quot;spawnme=true&quot;)
      
  value = open(&quot;myconfig.txt&quot;).read()
  print(value)
  
  if value == &quot;spawnme=true&quot;:
      print(&quot;YOU SPAWNED ME!&quot;)
  elif value == &quot;spawnme=false&quot;:
      pass
  else:
      print(&quot;Error reading config!&quot;)
  </code></pre>
  <p>Let's say the user tweaks the variable from true to false. But it simply just resets to true upon launch of the Python program due to the f.write code. Is there any other way to not reset the variable (false stays false, and true stays true). I apologize if there is something unclear. Thank you!</p>