(Solved) : Finish Star Project Python 27 First Picture Done Far Whats Steps Code Rest Startng Canvas Q37214361 . . .
howdo i finish this star project in python 2.7? the first picture iswhat i have done so far. Whats the steps and code for the reststartng a at canvas drawing setup. let me know if anything needed iwill respond almost istantly and you can come back and help






ba-Notepad File Edit Format View Help def getStarPixelX(star str): lis star str.split(“,”) x cor float(lis[e1) x pi cor- 250+(250*x cor) return x pi cor print getStarPixelx(“0.0,1.0,0.0,1,-1.5,1”) print getStarPixelX(“0.5,-0.5,0.0,2,2.0,2”) def getStarPixelY(star str): lis star_str.split(“,”) y cor -float (lis[1]) y pi_cor 250-(250*y cor) return y_pi_cor print getStarPixelY(“0.0,1.0,0.0,1,-1.5,1”) print getStarPixelY(“0.5,-0.5,0.0,2,2.0,2”) def getstarSize(star_str): lis star str.split(“,”) mag float (lis[4]) size val-10.0/(mag+2) return size val print getStarSize(“0.0,1.0,0.0,1,-1.5,1”) print getStarSize(“.5,-0.5,0.0,2,2.0,2”) def getStarName (star_str): lis star_str.split(“,”) star name if len (lis)-=7: star name – str(lis[-1]) return star inam print getStarllame(“0.0,1.0,0.0,1,-1.5,1,BOB print getStarllame(“0.5,-0.5,9.0,2,2.0,2″) We were unable to transcribe this imageacomplete drawing the canvas mainloop() drawStar0 Imput Parameter: a star string No Return Steps 1 1. Get the pixel x y, and size values for the star using the functions you previously defined 2. Calculate the leftX, topY, nightX, bottomY coordinates for the rectangle (Hint: size 2) 3. Draw the rectangle using the code below canvas.create rectangle(leftx, topy, rightx, bottony, fill-white, width-e) Below are some example function calls that draw stars o drawStar( 0.0,0.0,00,1,-1.5,1”) o drawStar05,0.5,00,2202) drawAlIStarsO DOLL We were unable to transcribe this image. Visualice Python Java, levaScrip Visudlicze Python, Jlava lavasenpx + 0OJTEC2120.20449 20194/asgs/stars project.html getStarString0 1 Input Parameter: a star’s name Return the star string of the star with matching name in the file stars.txt If no star with a matching name can be found, an error message should be printed and the be returned Hant: Search the file line by ine using the getStarName) function to se if the correct star string has been found Below are example function calls getStarString(“POLARIS-. “ο 010128,0007897,0 99991 8,8890. 197,424pOLARS. * getStarStrne(“BOB”) → ” with pr nted error mag-ERROR: No star called BOB could be found ” drawStarByName0 1 Imput Parameter: a star’s name No Returm Value Hint:Just use the getStarStringO and drawStar) functions to draw the mamed star Below are example function calls o drawStarBy o draw StarByName SIRIUS DELL We were unable to transcribe this imageVisualize python leva javascrip × Visualize Python, Java, JavaSeript X+ O.400.ITEC2120.20449.20194/asgs/stars,project.html drawConstellation File0 1 Input Parameter: A file name (File should be downloaded first) No Return Value. . Hint: Split each line by comma and call the drawConstellationLine0 function Below is an example function call. o drawConstellationFile BigDipper lines txt) Project Complete! thine (assuming all functions are complete and the files are downloaded) with the code below You can draw everything (assaming all functions are complete and the iles are dowtloaded with the code helow # แ4t up the qraphics library. trom Tkinter inport cenvas-pack #All your eode tineluding tusetion definitions, goes here in the drewhilstars 1atloiel Biipper1ines.tat LationPilel “Gemini lines.tat Show transcribed image text ba-Notepad File Edit Format View Help def getStarPixelX(star str): lis star str.split(“,”) x cor float(lis[e1) x pi cor- 250+(250*x cor) return x pi cor print getStarPixelx(“0.0,1.0,0.0,1,-1.5,1”) print getStarPixelX(“0.5,-0.5,0.0,2,2.0,2”) def getStarPixelY(star str): lis star_str.split(“,”) y cor -float (lis[1]) y pi_cor 250-(250*y cor) return y_pi_cor print getStarPixelY(“0.0,1.0,0.0,1,-1.5,1”) print getStarPixelY(“0.5,-0.5,0.0,2,2.0,2”) def getstarSize(star_str): lis star str.split(“,”) mag float (lis[4]) size val-10.0/(mag+2) return size val print getStarSize(“0.0,1.0,0.0,1,-1.5,1”) print getStarSize(“.5,-0.5,0.0,2,2.0,2”) def getStarName (star_str): lis star_str.split(“,”) star name if len (lis)-=7: star name – str(lis[-1]) return star inam print getStarllame(“0.0,1.0,0.0,1,-1.5,1,BOB print getStarllame(“0.5,-0.5,9.0,2,2.0,2”)
acomplete drawing the canvas mainloop() drawStar0 Imput Parameter: a star string No Return Steps 1 1. Get the pixel x y, and size values for the star using the functions you previously defined 2. Calculate the leftX, topY, nightX, bottomY coordinates for the rectangle (Hint: size 2) 3. Draw the rectangle using the code below canvas.create rectangle(leftx, topy, rightx, bottony, fill-white, width-e) Below are some example function calls that draw stars o drawStar( 0.0,0.0,00,1,-1.5,1″) o drawStar05,0.5,00,2202) drawAlIStarsO DOLL
. Visualice Python Java, levaScrip Visudlicze Python, Jlava lavasenpx + 0OJTEC2120.20449 20194/asgs/stars project.html getStarString0 1 Input Parameter: a star’s name Return the star string of the star with matching name in the file stars.txt If no star with a matching name can be found, an error message should be printed and the be returned Hant: Search the file line by ine using the getStarName) function to se if the correct star string has been found Below are example function calls getStarString(“POLARIS-. “ο 010128,0007897,0 99991 8,8890. 197,424pOLARS. * getStarStrne(“BOB”) → ” with pr nted error mag-ERROR: No star called BOB could be found ” drawStarByName0 1 Imput Parameter: a star’s name No Returm Value Hint:Just use the getStarStringO and drawStar) functions to draw the mamed star Below are example function calls o drawStarBy o draw StarByName SIRIUS DELL
Visualize python leva javascrip × Visualize Python, Java, JavaSeript X+ O.400.ITEC2120.20449.20194/asgs/stars,project.html drawConstellation File0 1 Input Parameter: A file name (File should be downloaded first) No Return Value. . Hint: Split each line by comma and call the drawConstellationLine0 function Below is an example function call. o drawConstellationFile BigDipper lines txt) Project Complete! thine (assuming all functions are complete and the files are downloaded) with the code below
You can draw everything (assaming all functions are complete and the iles are dowtloaded with the code helow # แ4t up the qraphics library. trom Tkinter inport cenvas-pack #All your eode tineluding tusetion definitions, goes here in the drewhilstars 1atloiel Biipper1ines.tat LationPilel “Gemini lines.tat
Expert Answer
Answer to how do i finish this star project in python 2.7? the first picture is what i have done so far. Whats the steps and code …
OR