python - 如何使用 SimpleGraphics 的用户输入绘制形状?
问题描述
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()
解决方案
推荐阅读
- bash - Bad substitution when passing parameter to shell script in Jenkins
- reactjs - spotify api returns 400
- ios - Why iOS build is not visible on the appstore connect
- django - Heroku Error: No application module specified. Django
- c - How to reduce execution time in this program
- android - Android App is running on some devices but doesn't on another devices...How to solve that?
- regex - 正则表达式“\|\|” 在 OCaml 中错误地匹配字符串“;;”
- c# - Blazor - HTML dropdown element once activated stops any further @OnClick event triggers
- ios - Apple Pay Integration using Cybersource -objective C
- ios - Mobile Vlc Kit Ios RepeatCurrent Not Working