Simple questions re name spaces

Cynthia Webber da57thJones at worldnet.att.net
Sat May 13 22:42:39 EDT 2000


Regarding 2 My mistake. It does indeed work fine. The problem was that I was
using a module named "test.py". Another module by the same name was already
in the Python path. Thanks for the advise

>> 2>
>> I have tried to dynamically create variables with code such as
>>
>> >>> a = "b = 'dog'"
>> >>> exec a
>> >>> print b
>> 'dog'
>>
>> This works from the command line but when I included it in a module it
>> fails.
>
>Could you post a pared down example.  When I try it here in a module,
>it works fine.






More information about the Python-list mailing list