Wrte array to text file using loop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrbones
    New Member
    • Feb 2008
    • 1

    Wrte array to text file using loop

    hey basically this script finds stuff on a list which has a bit added on, on the html profile for the name. The names are in a list and I want the names that it finds that have the extra bit wrote into a text file. At the moment the code gives the error IOError: [Errno 0] Error.
    Code:
    myfile = open('name.txt')
    name = checker[a]
    myfile.write(name + "/n")
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    Originally posted by mrbones
    hey basically this script finds stuff on a list which has a bit added on, on the html profile for the name. The names are in a list and I want the names that it finds that have the extra bit wrote into a text file. At the moment the code gives the error IOError: [Errno 0] Error.
    Code:
    myfile = open('name.txt')
    name = checker[a]
    myfile.write(name + "/n")
    You have opened the file in 'r' mode. Try mode 'w' or 'a'.

    Comment

    Working...