Shashwat Anand wrote:
> raw_input uses sys.stderr I guess ?
I had a look at the C code, but it's a bit confusing.
If I'm reading it correctly the prompt is written to the "real" stderr if
and only if sys.stdin and sys.stdout are attached to a terminal.
$ python -c"raw_input('prompt\n')" 2>tmp.
raw_input uses sys.stderr I guess ?
On Mon, Feb 15, 2010 at 5:35 PM, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
>
> >> > Does `raw_input` uses internally `sys.stdout.write`?
>
> > It was to display the output inside a GUI app. overriding
> > `sys.stdout`. And as `print` also uses
Joan Miller wrote:
>> > Does `raw_input` uses internally `sys.stdout.write`?
> It was to display the output inside a GUI app. overriding
> `sys.stdout`. And as `print` also uses internally `sys.stdout.write`
> then can be used `print` the shell script and get the output too in
> the GUI, cann't i
On 15 feb, 10:11, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
> > Does `raw_input` uses internally `sys.stdout.write`?
>
> You can test this yourself without reading the C source:
>
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
> [GCC 4.4.1] on linux2
> Type "help", "copyright",
Joan Miller wrote:
> Does `raw_input` uses internally `sys.stdout.write`?
You can test this yourself without reading the C source:
Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> clas
Does `raw_input` uses internally `sys.stdout.write`?
--
http://mail.python.org/mailman/listinfo/python-list