Re: Printing with raw_input

2010-02-16 Thread Peter Otten
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.

Re: Printing with raw_input

2010-02-15 Thread Shashwat Anand
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

Re: Printing with raw_input

2010-02-15 Thread Peter Otten
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

Re: Printing with raw_input

2010-02-15 Thread Joan Miller
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",

Re: Printing with raw_input

2010-02-15 Thread Peter Otten
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

Printing with raw_input

2010-02-15 Thread Joan Miller
Does `raw_input` uses internally `sys.stdout.write`? -- http://mail.python.org/mailman/listinfo/python-list