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.

--
Cheers,

Lou Pecora

Code 6362
Naval Research Lab
Washington, DC  20375
USA
Ph:  +202-767-6002
email:  [EMAIL PROTECTED]

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to