Dumb Stupid Question About List and String
python.koda at gmail.com
Wed Sep 1 17:11:31 CEST 2010
seems to have the same error with python.
In fact I was coding within nuke, a 2d compositing software (not the best)
unfortunately, I dont see how I can use dictionnary to do what I would like
2010/9/1 Xavier Ho <contact at xavierho.com>
> On 2 September 2010 00:47, Alban Nona <python.koda at gmail.com> wrote:
>> So I figure out this night how to create automatically varibales via
>> vars(), the script seems to work, exept that where it should give me a list
>> like :
>> [ELM004_DIF,ELM004_SPC,ELM004_RFL,ELM004_SSS, ELM004_REFR, ELM004_ALB,
>> etc...] it gave me just one entry in my list, and the last one [ELM004_WPP]
>> Any Ideas why that please ?
> Some comments:
> 1) Avoid overwriting global functions like list as a variable name. If you
> do that, you won't be able to use list() later in your code, and nor can
> anyone else who imports your code.
> 2) I'm a bit iffy about automatic variable generations. Why not just use a
> dictionary? What do others on comp.lang.python think?
> 3) I'm getting an error from your code, and it doesn't match with what you
> seem to get:
> # output
> Traceback (most recent call last):
> File "Test.py", line 33, in <module>
> print ELM001
> NameError: name 'ELM001' is not defined
> Did you get any compiler errors? I'm using Python 2.7
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list