Wow, I didn't expect so many responses! Thanks! I will have to try out all those solutions when I have access to my computer.. What I meant was that when the string was printed onto a text file, it showed lots of boxes that are usually associated with unknown characters...When I tried to work out what the boxes were caused by, I found that there were random characters in my text...So basically, I need the text to just be clean of anything silly looking and for some reason printing to a file doesn't remove the characters which really messed up the output.
This is an example of what I get: http://durand.zephyrhosting.net/tremcs/ Look at the top of the page under "Stats for..." The really weird thing is that it only happens with some strings and I have no idea how to predict which ones. Thanks again! I will let you know of the outcomes.
-- http://mail.python.org/mailman/listinfo/python-list