Vincent Davis wrote:
> Sorry for not being clear I would have something like this x = [1, 2,
> 3,5 ,6 ,9,234]
>
> Then def savedata(dataname): ..........
>
> savedata(x)
>
> this would save a to a file called x.csv This is my problem, getting
> the name to be x.csv which is the same as the name of the list.
>
> and the data in the file would be 1,2,3,5,6,9,234 this parts works
>
The list itself doesn't have a name. You need to pass in both the name
and the list:

def savedata(name, data): ..........

savedata("x", x)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to