Actually the easy answer to your question is use: sys.stdout.write(yourImageData) instead of print yourImageData That won't print the newline at the end. Kevin.