Use list name as string

Gary Herron gherron at
Wed Feb 4 11:35:32 EST 2009

Vincent Davis wrote:
> Do to laking knowledge my google searches have not turned up an answer for me.
> I know this is wrong it uses the items in the list as the filename,
> how do I refer to the dataname and not the items in it.
> def savedata(dataname):
>     filename = str(dataname)  # this does not do what I would like it to
>     ext1 = '\.csv'
>     flex = filename + ext1
>     datawrite = csv.writer(open(flex, "wb"))
>     datawrite.writerows(dataname)

I need more information to answer this question -- because I have no
idea what the question means.

  What is dataname?
  What would you like filename to be after that line.

One example of dataname and the desired filename is probably enough to
answer your question.
> Thanks
> Vincent Davis
> --

More information about the Python-list mailing list