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 NameError, e:
> ...             names.append(e[0][6:-16])
> ...     else:
> ...             break
> ...
>   
>>>> names
>>>>         
> ['a']
>   

That sure is nicer. My solution looks like shooting mosquitoes with an 
elephant rifle i comparison. Thanks.

/MiO
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to