sys.stdout.write()
This is one of the alternatives. You can also write sys.stderr. Personally, I use sys.stdoutit when I need to pass a common "stream" to some function that will write to it. And the open file is the stream, and the sys.stdoutstream. Thus, my function can be parameterized for writing, either for output or for a file.
sys.stdout.write , print , print , .
, . SO.