On Thu, 06 Jul 2006 04:20:01 -0700, manstey wrote:
> Hi,
>
> If I have a tuple like this:
>
> tupGlob = (('VOWELS','aeiou'),('CONS','bcdfgh'))
>
> is it possible to write code using tupGlob that is equivalent to:
> VOWELS = 'aeiou'
> CONS = ''bcdfgh'
Why don't you just do that?
VOWELS = 'aeio
manstey wrote:
> Hi,
>
> If I have a tuple like this:
>
> tupGlob = (('VOWELS','aeiou'),('CONS','bcdfgh'))
>
> is it possible to write code using tupGlob that is equivalent to:
> VOWELS = 'aeiou'
> CONS = ''bcdfgh'
could you use a dictionary instead? i.e.
>>> tupGlob = {'VOWELS':'aeiou', 'CONS':'
In <[EMAIL PROTECTED]>, Paul McGuire wrote:
tupGlob = (('VOWELS','aeiou'),('CONS','bcdfgh'))
for nam,val in tupGlob: locals()[nam]=val
> ...
VOWELS
> 'aeiou'
CONS
> 'bcdfgh'
Little warning: It works only on module level as assigning to `locals()`
return value in function
"manstey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> If I have a tuple like this:
>
> tupGlob = (('VOWELS','aeiou'),('CONS','bcdfgh'))
>
> is it possible to write code using tupGlob that is equivalent to:
> VOWELS = 'aeiou'
> CONS = ''bcdfgh'
>
> Thanks,
> Matthew
>
Try
Hi,
If I have a tuple like this:
tupGlob = (('VOWELS','aeiou'),('CONS','bcdfgh'))
is it possible to write code using tupGlob that is equivalent to:
VOWELS = 'aeiou'
CONS = ''bcdfgh'
Thanks,
Matthew
--
http://mail.python.org/mailman/listinfo/python-list