Message118237
The usual way to set a module variable by name, rather than
setattr(modules[__name__], 'name', 'value')
is
>>> globals()['name'] = 2
>>> name
2
Issues of working with external names, such as from database columns, has been discussed several times on python-list and the corresponding newsgroups. Please post there is you want to discuss that. |
|
Date |
User |
Action |
Args |
2010-10-08 23:55:23 | terry.reedy | set | recipients:
+ terry.reedy, eric.smith, docs@python, ssc |
2010-10-08 23:55:23 | terry.reedy | set | messageid: <1286582123.46.0.60230979674.issue10043@psf.upfronthosting.co.za> |
2010-10-08 23:55:21 | terry.reedy | link | issue10043 messages |
2010-10-08 23:55:21 | terry.reedy | create | |
|