how to turn a tuple to a string and back in python / how to edit an associative array on a web page
<p><strong>The problem I'm really trying to solve:</strong></p>

<p>I have a square table of true/false values, with rows and columns labelled by strings.</p>

<p>I want to display this as an html form with checkboxes, allow the user to tick and untick elements, then submit the form, and then I want to reconstruct the array from the form.</p>

<p><strong>The subproblem I'm trying to solve at the minute:</strong></p>

<p>I have a tuple of two strings, ("foo", "bar")</p>

<p>I want to turn that into the name of a checkbox in a webpage</p>

<p>And then when the form is submitted, turn that string back into the original tuple.</p>

<p>At the moment I'm doing, ("%s$%s" % ("foo", "bar"))-> "foo$bar" and then string.split('$') to get the strings back, which works fine but it's hackish and will break if the strings ever have dollars in them.</p>

<p>Obviously I can't just use repr and eval!</p>

<p>Is there a sane, standard way to do this?</p>
