如何使用SimpleGraphics使用来自用户的输入来绘制形状?

时间:2020-02-26 20:43:58

标签: python

from SimpleGraphics import *
f = open("shape.txt","w")
print("Please provide the necessary information below.")
while (True):
    s=input("please select one of following shapes (line, rect, elipse or quit): ")
    if s=="line":
      f.write(s+"\n")
      y=float(input("please enter you Y value: "))
      f.write(str(y)+"\n")
      x=float(input("please enter you X value: "))
      f.write(str(x)+"\n")
      h=float(input("please enter the value for the height: "))
      f.write(str(h)+"\n")
      w=float(input("please enter the value for the width: "))
      f.write(str(w)+"\n")
      c=input("please enter the colour: ")
      f.write=(c+"\n")
      print(h)
    if s=="quit":
     break
f.close()

0 个答案:

没有答案