coverting list back to string

scn regnivon at netscape.net
Mon Apr 21 15:32:11 EDT 2003


my code:

import xreadlines

input = open('c:/python22/programs/linetest.txt', 'r') # 3 lines of
text

output = open('c:/python22/programs/output.txt', 'w')

for line in input.xreadlines():
    remove = line.split()
    remove[0:1] = []
    output.write(remove)

output.close()
input.close()

my quest:  i know that output.write(remove) is not correct.  you
cannot use the 'write' method on a list.  is there a better way to
convert the list to a string after the first element of the list has
been removed and then output the strings to a file?  i'm a newbie
programmer and need guru help. thank you.




More information about the Python-list mailing list