On 19 June 2012 00:53, Jason Friedman ja...@powerpull.net 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)module()
- import sys
(Pdb) *** NameError: name 'hello' is not defined
--
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 recent call last):
File stdin, line 1, in module
TypeError: invalid file:
On Mon, Jun 18, 2012 at 4:13 PM, Jason Friedman ja...@powerpull.net 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 recent
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'
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
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)module()
- import sys
(Pdb) *** NameError: name 'hello' is not defined
--
http://mail.python.org/mailman/listinfo/python-list