Ask Your Question
0

sys.stdin in Wing IDE problem

asked 2018-02-22 03:59:00 -0500

Alexander Pavolotsky's avatar

updated 2020-01-22 19:53:11 -0500

Hi.Trying to test simple python-program using stdin object.

import sys

w = []
for s in sys.stdin:
    w.append(s)

print(w)

To stop inputing I send EOF with right-button mouse click. But program terminates and nothing print out.This situation is in Wing IDE 101 under MacOS and Windows.

So, I can't run and test any program that uses stdin.

How can I solve this problem?

Thanx

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2019-03-13 08:44:24 -0500

The program does work for me outside of Wing and I see that it's not working in Wing in either Python Shell or when debugged. The reason for this is apparently that sending EOF doesn't seem to be working. We'll look into what is causing that.

A work-around is to go into the Options menu in the Debug I/O tool and select Configure External Console. Then check on Use External Console. You'll get a separate console window when you debug and pressing Ctrl-D there to send EOF does work and it prints the output and exits.

Thanks for reporting this and sorry for the slow response. We just moved the Q&A forum to another provider and I think we didn't get notice of your question because it hasn't been fully configured yet.

edit flag offensive delete link more

Comments

This will be fixed in the Debug I/O, Python Shell, and Debug Probe tools (so the Send EOF item in right-click menu works) in Wing 6.1.6+ and 7rc1+.

Wingware Support's avatar Wingware Support  ( 2019-03-14 09:17:08 -0500 )edit
0

answered 2018-02-22 09:15:00 -0500

Mark Jones's avatar

updated 2019-03-07 09:01:42 -0500

Wingware Admin's avatar

That program doesn't work outside of wing either.

If you are writing test code, try putting your inputs into a file and reading from the file.  Then you can use UnitTest instead of typing the same inputs over and over

But the problem with the above program is not wing.

edit flag offensive delete link more

Comments

It's strange, but this program works good.

Here is a screenshot.https://www.screencast.com/t/12Tq26cTHghj

In bash I can stop inputting sending Ctrl+D.And this is from Wing https://www.screencast.com/t/JNUmFMEnHs 

And here is video from PyCharm https://screencast.com/t/f3rHRZb3PQ

Alexander Pavolotsky's avatar Alexander Pavolotsky  ( 2018-02-22 10:06:00 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-02-22 03:59:00 -0500

Seen: 4,852 times

Last updated: Mar 13 '19