Ooops, w must be 'w' - sorry for adding more confusion :-D
I would also like to add that this is a more realistic useage appendix = '.txt' # or '.csv' or whatever # some code c += 1 filetitle = 'result_' + zeropadding(c) + str(c) myfile = open(filetitle+appendix,'w') # etc Hope that was a little better. /P9K -- http://mail.python.org/mailman/listinfo/python-list