Peter Otten wrote:
> Clearly more elegant than:
>
>
print open(filename).read()
> b = a
>
dummy = 42
names = []
while 1:
> ... ns = dict((n, dummy) for n in names)
> ... try:
> ... execfile(filename, ns)
> ... except Name
Mikael Olofsson wrote:
> Peter Otten wrote:
>> To feed an arbitrary mapping object to execfile() you need to upgrade to
>> Python 2.4.
>
> Thanks! As clear as possible. I will do that.
>
> FYI: I think I managed to achieve what I want in Py2.3 using the
> compiler module:
>
> def getNamesFr
Peter Otten wrote:
> To feed an arbitrary mapping object to execfile() you need to upgrade to
> Python 2.4.
Thanks! As clear as possible. I will do that.
FYI: I think I managed to achieve what I want in Py2.3 using the
compiler module:
def getNamesFromAstNode(node,varSet):
if node._