[Pythonmac-SIG] Re: Getting stdin using TextWrangler or BBEdit, but not MacPython

Louis Pecora pecora at anvil.nrl.navy.mil
Thu Mar 3 23:32:01 CET 2005

Bob Ippolito wrote:

> I don't know a damn thing about TextWrangler, but this works with any 
> Python that has a working stdin:
> while True:
>     text = raw_input("Input 2 ints and a float: ")
>     try:
>         i1, i2, f1 = [t(v) for (t, v) in zip((int, int, float), 
> text.split())]
>     except ValueError, e:
>         print 'Invalid Entry: %s' % (e,)
>         continue
>     break
Yes, it works in a terminal.  But it doesn't work in TextWrangler.  Must be something about how that code editing app handles the Python I/O.  But I can't expect you to fix that.  :-) 

Thanks for your help.  Will deal with the terminal approach.  
Muchas gracias.


Lou Pecora

Code 6362
Naval Research Lab
Washington, DC  20375
Ph:  +202-767-6002
email:  pecora at anvil.nrl.navy.mil

More information about the Pythonmac-SIG mailing list