(Tried to answer before but it didn't go through) It works fine in TextWrangler if you choose (from TW's Run submenu) Run in Terminal; you're still doing your work in TW, just using Terminal for i/o.

Charles Hartman
Professor of English, Poet in Residence
http://cherry.conncoll.edu/cohar
http://villex.blogspot.com

On Mar 3, 2005, at 5:34 PM, Louis Pecora wrote:

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


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

Reply via email to