Stdin in PyDev (Eclipse) [message #1771305] |
Wed, 23 August 2017 20:35 |
Andrew D Messages: 1 Registered: August 2017 |
Junior Member |
|
|
Hi,
I have problem with this script in Eclipse:
import stdio
import stddraw
# Read x and y scales from standard input, and configure standard
# draw accordingly. Then read points from standard input until
# end-of-file, and plot them on standard draw.
x0 = stdio.readFloat()
y0 = stdio.readFloat()
x1 = stdio.readFloat()
y1 = stdio.readFloat()
stddraw.setXscale(x0, x1)
stddraw.setYscale(y0, y1)
# Read and plot the points.
stddraw.setPenRadius(0.0)
while not stdio.isEmpty():
x = stdio.readFloat()
y = stdio.readFloat()
stddraw.point(x, y)
stddraw.show()
I use file usa.txt (at attachments) as "Input file" in "Run configurations".
I get a black stddraw window which does not respond. If I type "Ctrl-Z" ("Ctrl-D" In Mac) in Eclipse console, then I get a result sometimes.
I've run this script in debugger - it stops on line of stdio.py (with operator "line = sys.stdin.readline()") for last line of usa.txt.
I run this script in Terminal ("python plotfilter.py < usa.txt"). It works.
I've run this file in Geany - it works!
Is it a bug in PyDeve (Eclipse)?
Thanks!
-
Attachment: usa.txt
(Size: 369.42KB, Downloaded 200 times) -
Attachment: one.py
(Size: 0.55KB, Downloaded 129 times) -
Attachment: stddraw.py
(Size: 24.35KB, Downloaded 118 times) -
Attachment: stdio.py
(Size: 10.07KB, Downloaded 155 times)
|
|
|
Powered by
FUDForum. Page generated in 5.08242 seconds