On 19 June 2012 00:53, Jason Friedman wrote:
> Which leads me to another question ... how can I debug these things?
>
> $ echo 'hello' | python3 -m pdb ~/my-input.py
> > /home/jason/my-input.py(2)()
> -> import sys
> (Pdb) *** NameError: name 'hello' is not defined
> --
> http://mail.python.org/m
Which leads me to another question ... how can I debug these things?
$ echo 'hello' | python3 -m pdb ~/my-input.py
> /home/jason/my-input.py(2)()
-> import sys
(Pdb) *** NameError: name 'hello' is not defined
--
http://mail.python.org/mailman/listinfo/python-list
> sys.stdin wraps a buffered reader which itself wraps a raw file reader.
>
sys.stdin
> <_io.TextIOWrapper name='' mode='r' encoding='UTF-8'>
sys.stdin.buffer
> <_io.BufferedReader name=''>
sys.stdin.buffer.raw
> <_io.FileIO name='' mode='rb'>
>
> You should read from sys.stdin.buffe
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='' mode='r' encoding='UTF-8'>
>>> sys.stdin.buffer
<_io.BufferedReader name=''>
>>> sys.stdin.buffer.raw
<_io.FileIO name='' m
On Mon, Jun 18, 2012 at 4:13 PM, Jason Friedman wrote:
> I tried this:
>
> Python 3.2.2 (default, Feb 24 2012, 20:07:04)
> [GCC 4.6.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
import sys
import io
fh = io.open(sys.stdin)
> Traceback (most re