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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!