Re: naming objects from string
- From: Damjan <gdamjan@xxxxxxxxx>
- Date: Thu, 21 Sep 2006 06:53:08 +0200
manstey wrote:
Hi,
But this doesn't work if I do:
a=object()
x='bob'
locals()[x] = a
How can I do this?
try
sys.modules[__name__].__dict__[x] = a
But what's the point?
--
damjan
.
- Follow-Ups:
- Re: naming objects from string
- From: Wildemar Wildenburger
- Re: naming objects from string
- References:
- naming objects from string
- From: manstey
- Re: naming objects from string
- From: James Stroud
- Re: naming objects from string
- From: manstey
- naming objects from string
- Prev by Date: Re: naming objects from string
- Next by Date: Re: naming objects from string
- Previous by thread: Re: naming objects from string
- Next by thread: Re: naming objects from string
- Index(es):