Python: how to write a data struct to a file as text (not pickled)
<p>Is there a way to write python data structs to a file as text.</p>

<p>e.g. an app is running and has a variable/object: OPTIONS = ('ON', 'OFF', )</p>

<p>I need to write/merge the OPTIONS tuple into another file, not as a 
pickled object, but as text, verbatim: OPTIONS = ('ON', 'OFF', )</p>

<p>I could traverse the tuple, and one by one write the elements into
the target file, but was wondering if there's an easier way.</p>

<p>note: if i do a "straight" write, i get the following:</p>

<pre><code>fout.write(OPTIONS)
 ... 
TypeError: argument 1 must be string or read-only character buffer, not tuple
</code></pre>
