Question: ignore question (a). (code that needs filling) from tkinter import * #------------------------------------------- #------------------------------------------- # a) Makes one change to the main() function #------------------------------------------- def main():
ignore question (a).


(code that needs filling)
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 is the CircumferencePoints.txt file) 549.9619237890978 304.3631016093209 549.6573836886434 313.083989060736 549.0486745229364 321.78893568691456 548.1365379103305 330.46733585128686 546.9220851487844 339.1086162600577 545.406795861916 347.7022488441362 543.5925161963088 356.23776358596626 541.4814565722671 364.7047612756302 539.0761889907589 373.0929261806842 536.3796438998293 381.39203861428916 533.3951066243004 389.59198738632506 530.1262133631101 397.68278212231843 526.5769467591625 405.65456543517485 522.7516310470919 413.4976249348867 518.654926784849 421.2024050615843 514.2918251755281 428.7595187275135 509.667641986356 436.15975875375676 504.78801107224797 443.39410908776154 499.6588775118232 450.4537557880121 494.2864903642427 457.33009776245933 488.677395055693 464.0147572476268 482.8384254047926 470.4995900156246 476.7766952966369 476.77669529663683 470.4995900156246 482.8384254047926 464.01475724762685 488.67739505569295 457.3300977624594 494.2864903642427 450.45375578801213 499.6588775118232 443.39410908776154 504.7880110722479 436.15975875375676 509.667641986356 428.7595187275135 514.2918251755281 421.2024050615843 518.654926784849 413.4976249348867 522.7516310470919 405.65456543517485 526.5769467591625 397.68278212231843 530.1262133631101 389.5919873863251 533.3951066243004 381.39203861428916 536.3796438998291 373.0929261806842 539.0761889907589 364.7047612756302 541.4814565722671 356.2377635859662 543.5925161963088 347.70224884413625 545.406795861916 339.1086162600577 546.9220851487844 330.46733585128686 548.1365379103305 321.78893568691456 549.0486745229364 313.083989060736 549.6573836886434 304.3631016093209 549.9619237890978 295.6368983906791 549.9619237890978 286.916010939264 549.6573836886434 278.21106431308544 549.0486745229364 269.53266414871314 548.1365379103305 260.8913837399423 546.9220851487844 252.2977511558638 545.406795861916 243.76223641403374 543.5925161963088 235.29523872436977 541.4814565722671 226.90707381931583 539.0761889907589 218.60796138571084 536.3796438998293 210.40801261367494 533.3951066243004 202.31721787768154 530.1262133631101 194.34543456482515 526.5769467591625 186.5023750651133 522.7516310470919 178.79759493841578 518.654926784849 171.24048127248645 514.2918251755281 163.84024124624324 509.667641986356 156.60589091223846 504.7880110722479 149.5462442119879 499.6588775118232 142.66990223754067 494.2864903642428 135.9852427523732 488.67739505569307 129.5004099843754 482.8384254047927 123.22330470336314 476.7766952966369 117.16157459520738 470.4995900156246 111.32260494430699 464.0147572476268 105.71350963575728 457.33009776245933 100.34112248817675 450.453755788012 95.21198892775203 443.3941090877615 90.33235801364401 436.1597587537568 85.70817482447197 428.75951872751364 81.34507321515107 421.2024050615843 77.24836895290807 413.49762493488674 73.4230532408375 405.65456543517485 69.87378663688992 397.68278212231843 66.60489337569956 389.59198738632506 63.620356100170795 381.39203861428916 60.92381100924112 373.0929261806841 58.518543427732936 364.7047612756303 56.40748380369121 356.2377635859663 54.59320413808402 347.70224884413625 53.07791485121558 339.1086162600577 51.8634620896695 330.46733585128686 50.95132547706362 321.78893568691456 50.34261631135655 313.083989060736 50.038076210902176 304.36310160932084 50.038076210902176 295.6368983906791 50.34261631135655 286.9160109392641 50.95132547706362 278.2110643130855 51.86346208966947 269.5326641487132 53.07791485121555 260.8913837399423 54.59320413808402 252.2977511558638 56.40748380369118 243.76223641403377 58.51854342773291 235.2952387243698 60.92381100924115 226.9070738193158 63.620356100170824 218.60796138571078 66.60489337569959 210.40801261367488 69.87378663688992 202.31721787768163 73.42305324083748 194.34543456482518 77.24836895290804 186.5023750651133 81.34507321515105 178.79759493841578 85.70817482447191 171.24048127248645 90.33235801364398 163.84024124624324 95.21198892775209 156.60589091223846 100.34112248817678 149.5462442119879 105.7135096357573 142.66990223754058 111.32260494430696 135.9852427523732 117.16157459520733 129.5004099843754 123.22330470336308 123.22330470336314 129.50040998437535 117.16157459520738 135.98524275237315 111.32260494430702 142.66990223754055 105.71350963575736 149.54624421198793 100.34112248817678 156.6058909122384 95.21198892775212 163.84024124624327 90.33235801364398 171.2404812724864 85.70817482447197 178.79759493841578 81.34507321515105 186.50237506511326 77.24836895290807 194.3454345648252 73.42305324083745 202.31721787768154 69.87378663688995 210.40801261367483 66.60489337569959 218.60796138571084 63.620356100170795 226.90707381931574 60.92381100924118 235.29523872436982 58.51854342773291 243.76223641403368 56.40748380369121 252.29775115586386 54.59320413808402 260.8913837399422 53.07791485121558 269.5326641487132 51.86346208966947 278.21106431308544 50.95132547706362 286.9160109392639 50.34261631135655 295.6368983906791 50.038076210902176 304.3631016093208 50.038076210902176 313.083989060736 50.34261631135655 321.78893568691444 50.95132547706362 330.4673358512869 51.8634620896695 339.10861626005766 53.07791485121555 347.7022488441363 54.59320413808405 356.2377635859662 56.40748380369118 364.70476127563006 58.51854342773291 373.0929261806842 60.92381100924115 381.39203861428905 63.62035610017077 389.5919873863251 66.60489337569956 397.6827821223184 69.87378663688989 405.6545654351749 73.42305324083753 413.49762493488663 77.24836895290801 421.2024050615843 81.3450732151511 428.7595187275135 85.70817482447191 436.15975875375665 90.33235801364393 443.39410908776154 95.21198892775206 450.453755788012 100.34112248817672 457.3300977624594 105.7135096357573 464.0147572476268 111.32260494430693 470.4995900156247 117.16157459520738 476.77669529663683 123.22330470336308 482.8384254047927 129.50040998437544 488.67739505569295 135.98524275237315 494.28649036424264 142.66990223754055 499.6588775118232 149.54624421198793 504.78801107224785 156.6058909122384 509.667641986356 163.84024124624327 514.2918251755281 171.2404812724864 518.654926784849 178.79759493841578 522.7516310470919 186.50237506511326 526.5769467591625 194.3454345648252 530.1262133631101 202.31721787768151 533.3951066243004 210.40801261367483 536.3796438998293 218.60796138571084 539.0761889907589 226.9070738193157 541.4814565722671 235.29523872436982 543.5925161963088 243.76223641403368 545.406795861916 252.29775115586384 546.9220851487844 260.8913837399422 548.1365379103305 269.5326641487132 549.0486745229364 278.21106431308544 549.6573836886434 286.9160109392639 549.9619237890978 295.6368983906791
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
Get step-by-step solutions from verified subject matter experts
