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


-bob

I should add that calling raw_input() gives the following error:

File "Drive:Users:louispecora:Code:python:test_folder:junk.py"; Line 12: EOFError: EOF when reading a line

Not sure what that tells you, but it seems to be how TextWrangler is dealing with stdin. Almost sounds like it is expecting input to be right there when called and seeing none, just sees an EOF. Oh, well.

--
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