Read STDIN as bytes rather than a string
Christian Heimes
lists at cheimes.de
Mon Jun 18 19:35:31 EDT 2012
More information about the Python-list mailing list
Mon Jun 18 19:35:31 EDT 2012
- Previous message (by thread): Read STDIN as bytes rather than a string
- Next message (by thread): Read STDIN as bytes rather than a string
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 19.06.2012 01:13, schrieb Jason Friedman: > I tried this: sys.stdin wraps a buffered reader which itself wraps a raw file reader. >>> sys.stdin <_io.TextIOWrapper name='<stdin>' mode='r' encoding='UTF-8'> >>> sys.stdin.buffer <_io.BufferedReader name='<stdin>'> >>> sys.stdin.buffer.raw <_io.FileIO name='<stdin>' mode='rb'> You should read from sys.stdin.buffer unless you really need the bare metal. Christian
- Previous message (by thread): Read STDIN as bytes rather than a string
- Next message (by thread): Read STDIN as bytes rather than a string
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list