Question
Write a python program that allows users to draw SimpleGraphics shapes by issuing commands through the command line. You should ask the user to select
Write a python program that allows users to draw SimpleGraphics shapes by issuing commands through the command line. You should ask the user to select one of three shapes (line, rect or ellipse) and enter the shape specifications and color. The user should enter quit to stop entering input. Your program should save this information on a text file shapes.txt using the following pattern.
line X1 Y1 X2 Y2 color
OR
rect X Y width height color
OR
ellipse X Y width height color
Output sample
rect 200 250 150 300 red line 50 100 300 250 green ellipse 100 400 200 150 blue rect 400 100 75 200 yellow
Write and test a function that reads the content of shapes.txt file and draw those shapes with the given specifications using SimpleGraphics module.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started