Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ignore question (a), do the (c) function (code to fill in) from tkinter import * #------------------------------------------- #------------------------------------------- # a) Makes one change to the main()

Ignore question (a), do the (c) function

image text in transcribedimage text in transcribed

(code to fill in)

from tkinter import * #------------------------------------------- #------------------------------------------- # a) Makes one change to the main() function #------------------------------------------- def main(): canvas_width = 600 canvas_height = 600 window = Tk() window.title("A5 Question 2 by") geometry_string = str(canvas_width)+"x"+str(canvas_height)+"+10+20" window.geometry(geometry_string) a_canvas = Canvas(window) a_canvas.config(background="misty rose") a_canvas.pack(fill=BOTH, expand = True) #Canvas fills the whole top level window centre_x = 300 centre_y = 300 radius = 250 circle_pts = get_list_of_tuples_from_file("CircumferencePoints.txt") draw_outer_circle(a_canvas, centre_x, centre_y, radius) draw_cardioid_connections(a_canvas, circle_pts) window.mainloop() #------------------------------------------- #------------------------------------------- # Reads the list of points from the file # (each point is a tuple of two integers) # b) Complete the get_list_of_tuples_from_file() function #------------------------------------------- def get_list_of_tuples_from_file(filename): pass #------------------------------------------- #------------------------------------------- # Draws the connecting lines of the cardioid # c) Complete the draw_outer_circle() function # d) Complete the draw_cardioid_connections() function #------------------------------------------- def draw_outer_circle(a_canvas, centre_x, centre_y, radius): colour = "medium purple" def draw_cardioid_connections(a_canvas, points_on_circumference): colour = "medium orchid" main() 
This program reads points from a text file and creates a String Art cardioid pattern by drawing a series of lines between the points For this question, you may use any colours of your choosing. a) Currently the title bar of the program window displays "A5 Question 2 by". Add your username to the title bar of the program, i.e., the title bar should display the string, "A5 Question 2 by yourUsername", e.g., A5 Question 2 by afer023

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is meant by the term attainable set?

Answered: 1 week ago