Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Lv 610,889 points

Jared

Favorite Answers58%
Answers1,199
  • python: write list to file?

    I have a python list that looks like:

    cont =

    ['0.0982','0.025']

    ['0.0983','0.024']

    ...

    and so on.

    I use

    fid2 = open(newfile,'w')

    fid2.writelines(cont)

    fid2.close()

    I get the following error: writelines() argument must be a sequence of strings.

    How do I write that list to a file?

    2 AnswersProgramming & Design1 decade ago