Dynamic variable names
R (Chandra) Chandrasekhar
chyavana at gmail.com
Sun Feb 7 06:32:14 EST 2010
More information about the Python-list mailing list
Sun Feb 7 06:32:14 EST 2010
- Previous message (by thread): Simulating logging.exception with another traceback
- Next message (by thread): Dynamic variable names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Dear Folks, I have read that one should use a dictionary in python to accommodate dynamic variable names. Yet, I am puzzled how to achieve that in my case. Here is what I want to do: 1. The user inputs a number of six-digit hex numbers as a comma-separated list. These numbers represent colours, but the number of colours is not known beforehand. 2. Using these colours in pairs, I am generating image files whose names must be unique. I could use the respective hex numbers for this, but would like to explore generating filenames like colour_1-colour_2.jpg Because I do not know how many colours there would be in advance, I need to generate the colour_n names on the fly. So, my two questions are: 1. How do I do this properly in python? 2. If there is a better scheme than what I have outlined, can someone please point me to a Web link? Thank you. Chandra
- Previous message (by thread): Simulating logging.exception with another traceback
- Next message (by thread): Dynamic variable names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list