I guess what I am saying is that it does not seem like I am adding any information that is not already there when I have to enter that list and list name after all they are the same.<div><br clear="all">Thanks<br>Vincent Davis<br>
<br>
<br><br><div class="gmail_quote">On Wed, Feb 4, 2009 at 10:18 AM, Vincent Davis <span dir="ltr"><<a href="mailto:vincent@vincentdavis.net">vincent@vincentdavis.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I know nothing but that sucks. I can think of a lot of times I would like to do something similar. There really is no way to do this, it seems like there would be some simple way kind of like str(listname) but backwards or different.<div>
<br><div><div>Thanks<br><font color="#888888">Vincent Davis</font><div><div></div><div class="Wj3C7c"><br><br>
<br><br><div class="gmail_quote">On Wed, Feb 4, 2009 at 10:07 AM, MRAB <span dir="ltr"><<a href="mailto:google@mrabarnett.plus.com" target="_blank">google@mrabarnett.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Vincent Davis wrote:<br>
> Sorry for not being clear I would have something like this x = [1, 2,<br>
> 3,5 ,6 ,9,234]<br>
><br>
> Then def savedata(dataname): ..........<br>
><br>
> savedata(x)<br>
><br>
> this would save a to a file called x.csv This is my problem, getting<br>
> the name to be x.csv which is the same as the name of the list.<br>
><br>
> and the data in the file would be 1,2,3,5,6,9,234 this parts works<br>
><br></div>
The list itself doesn't have a name. You need to pass in both the name<br>
and the list:<br>
<br>
def savedata(name, data): ..........<br>
<br>
savedata("x", x)<div><div></div><div><br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>