标准输入到绘图过滤器(plotfilter.py)

 1 import stddraw
 2 import stdio
 3 # Read and set the x- and y- scales
 4 x0 = stdio.readFloat()
 5 y0 = stdio.readFloat()
 6 x1 = stdio.readFloat()
 7 y1 = stdio.readFloat()
 8 stddraw.setXscale(x0, x1)
 9 stddraw.setYscale(y0, y1)
10 # Read and plot the points
11 stddraw.setPenRadius(0.0)
12 while not stdio.isEmpty():
13     x = stdio.readFloat()
14     y = stdio.readFloat()
15     stddraw.point(x, y)
16 stddraw.show()

 

 

 

posted @ 2017-08-03 13:50  跳过了E  阅读(288)  评论(0编辑  收藏  举报