Parsing & question about usages off classes!

Peter Hansen peter at engcorp.com
Sun Nov 3 15:34:24 EST 2002


Frans wrote:
> I want to create several new list. The name off the new lists will come 
> from another list. That way I can create several lists, depending on the 
> data received from logfiles. Is that possible ?
> 
> Or isnt that a good idea either ? :)

Correct, this is also not a good idea.

> So basicly:
> my_list['some','data']
> variable = my_list[0]
> variable = list
> 
> Now this doesnt work, but the result I want is a new list with the name 
> 'some'.

Now why would you want that?  You would have to write code in advance
that uses the variable name, even before you know what the variable
name is going to be?  Rethink the approach: you can't get where you
want to be from here.

Can you explain why you think you want a new list with the name "some"?
If you can dig down to your real requirements and express them here,
we can probably show you how to approach the problem in a more
workable fashion.

-Peter




More information about the Python-list mailing list