http://docs.python.org/2/library/stdtypes.html#file.write
file.write(str)
Write a string to the file. There is no return value. Due to buffering, the string may not actually show up in the file until the flush() or close() method is called.
http://docs.python.org/dev/library/sys.html#sys.stdout
stdout is used for the output of print() and expression statements and for the prompts of input();
[…]
When interactive, standard streams are line-buffered. Otherwise, they are block-buffered like regular text files. You can override this value with the -u command-line option.
To write or read binary data from/to the standard streams, use the underlying binary buffer. For example, to write bytes to stdout, use sys.stdout.buffer.write(b'abc').
# La doc était pourtant assez claire...
Posté par Jerome . En réponse au message sys.stdout.write() avec python3 : pas d'écriture tant que pas EOL ?. Évalué à 3.
http://docs.python.org/2/library/stdtypes.html#file.write
file.write(str)
Write a string to the file. There is no return value. Due to buffering, the string may not actually show up in the file until the flush() or close() method is called.
http://docs.python.org/dev/library/sys.html#sys.stdout
stdout is used for the output of print() and expression statements and for the prompts of input();
[…]
When interactive, standard streams are line-buffered. Otherwise, they are block-buffered like regular text files. You can override this value with the -u command-line option.
To write or read binary data from/to the standard streams, use the underlying binary buffer. For example, to write bytes to stdout, use sys.stdout.buffer.write(b'abc').