How do I assign a variable to an object name?
<p>Tried the following, where "objectname" contains a string name, to be assigned on creation of an object.</p>

<pre><code>for record in result:
    objectname = 'Customer' + str(record[0])
    print objectname
    customername = str(record[1])
    objectname = Customer(customername)
</code></pre>

<p>Where Customer is a class.</p>

<p>In my test, this loop runs twice printing "objectname" as Customer1 and Customer2, yet creates 2 objects, but the objects are called "objectname" (it overwrites each loop), opposed to the 2 unique objects Customer1 or Customer2.</p>

<p>Its simply not assigning strings(customer1,2) inside the variable, but purely the variables name.</p>

<p>I've tried assigning strings to the object name, but that gives a syntax error</p>

<p>Surely this must be done all the time, thanks for your help in advance.</p>
