Hello all: I have the following snippet:
In [1]: fileName = 'Perfect Setup.txt\n' In [2]: fileName = fileName[0:len(fileName)-1)] # remove the '\n' character In [3]: fileName Out[3]: 'Perfect Setup.txt' Question one: Does python provide any function that can remove the last character of a string? I don't know whether or not the method I used is efficient Question two: Does python provide any function that can remove the newline character from a string if it exists? Thank very much! -Daniel -- http://mail.python.org/mailman/listinfo/python-list