I\'m fairly new when it comes to programming, and have started out learning python.
What I want to do is to recolour sprites for a game, and I am given the original
for pix in filename:
iterates over the letters of the filename. So that's certainly not what you want. You'll probably want to replace that line by:
with open(filename) as current_file:
for pix in current_file:
(assuming Python 2.6) and indent the rest of the loop accordingly.
However, I'm not sure that the new for
loop does what you want unless by pix
you mean a line of text in the current file. If the files are binary picture files, you'll first need to read their contents correcty - not enough info in your post to guess what's right here.