| If you need to have more list why not using a dictionary of lists where key is the name and value is the list?
lists = {"list1" : [0,1,2] , "list2" : [2, 3 ,4]}
----Messaggio originale----
Da: belangeo@gmail.com
Data: 04/02/2012 15.12
A: <csound@lists.bath.ac.uk>
Ogg: Re: [Csnd] python question
A simpler solution could be to put your name into the list and split it inside your function:
foo = ["foo", 1, 2, 3, 4, 5]
def my_func(lst): name = lst[0] data = lst[1:]
Olivier
2012/2/4 luis jure <ljc@internet.com.uy>
on 2012-02-04 at 12:28 Richard Dobson wrote:
>Which is enough to suggest to me that your solution combining a list
>with its name really is the most elegant option.
by now i'm totally convinced of that. mainly because at my newbie stage,
i'm in no condition to even think of anything more sophisticated than
that...
thanks to all that responded! i think it would be a good idea to subscribe
to a python-specific mailing list. i'm having great fun learning the
language, and i'm liking it very much so far. this is the first problem i
encounter where i would have wished for a more direct and elegant solution.
best,
lj
|