I have this menu: [1] load shapes, [2] exit the program, [3] add shapes. my python program uses graphics.py and is supposed to load a txt file that has a bunch of random shapes such as: rectangle, 500,500, 550,580, green point, 200,50,black triangle, 500,100, 600,100, 550,200, yellow oval, 100,100, 400,200, red text, 500,50, hello world!, blue polygon, 300,550, 500,550, 450,350, 350,350, blue and so on. my program should be able load in a text file and draw the shapes no matter what the shapes parameters are. They wont be these specific colors and sizes. If my user chooses option [1] load shapes, it should give them the option to input the name of the file, then draw the shapes on that file that my program supports. It should also ignore any #comments or blank lines that the text file contains. Also should close the program/window if the user chooses option [2] if the user chooses option[3] it should give them the choice to add a drawing of either a rectangle or a circle to the window.
I have this menu: [1] load shapes, [2] exit the
rectangle, 500,500, 550,580, green
point, 200,50,black
triangle, 500,100, 600,100, 550,200, yellow
oval, 100,100, 400,200, red
text, 500,50, hello world!, blue
polygon, 300,550, 500,550, 450,350, 350,350, blue
and so on.
my program should be able load in a text file and draw the shapes no matter what the shapes parameters are. They wont be these specific colors and sizes. If my user chooses option [1] load shapes, it should give them the option to input the name of the file, then draw the shapes on that file that my program supports. It should also ignore any #comments or blank lines that the text file contains.
Also should close the program/window if the user chooses option [2]
if the user chooses option[3] it should give them the choice to add a drawing of either a rectangle or a circle to the window.
Step by step
Solved in 2 steps with 2 images