PYTHON (Basic GUI Programming Using Tkinter):
(Draw an arrow line)
Write a program that randomly draws an arrow line when the Draw a Random Arrow Line button is clicked, as shown in Figure:
Explanation::
Code in PYTHON::
from tkinter import * import tkinter as tk import random window = Tk() window.geometry("500x500") window.title("Random an Arrow Line") def drawArrow(): canvas = tk.Canvas(window, width=500, height=500) canvas.pack() xy=[] for i in range(4): xy.append(random.randint(0,501)) canvas.create_line(xy[0], xy[1], xy[2], xy[3], arrow=tk.LAST) button() def button(): B = Button(window, text = "Draw a Random Arrow Line", command = drawArrow) B.place(x = 150,y = 476) button() window.mainloop()
Screenshot of the CODE:
OUTPUT::
TEST CASE 1:
TEST CASE 2:
Please provide the feedback!!
Thank You!!
PYTHON (Basic GUI Programming Using Tkinter): (Draw an arrow line) Write a program that randomly draws...
Python 3.6 I need the code ready to run using GUI programming Write a program for the Knight's Tour problem. Your program should let the user move a knight to any starting square and click the Solve button to animate a knight moving along the path, as shown below.
Using Python, please write a program that draws the following shapes using turtles and tkinter: Tetrahedron Cube Octahedron Dodecahedron Icosahedron Please make sure they're drawn out using only lines in the 2D dimension. All the shapes need to be in the same window. No need to color them. Thank you.
Python Consider the GUI below (3 Labels and 3 Radiobuttons) which has been produced with a Python program using the Tkinter library. You are required to write a Python program to produce this interactive GUI. Your GUI must replicate the example above as closely as possible, including the same widgets displayed in the sample positions on the GUI, using the same colours, shapes and relative sizes. (Note that the GUI border in the sample output does not need to be...
Using Python GUI from tkinter import * from tkinter.ttk import * def main(): window = Tk() window.mainloop() main() Create a basic integer calculator program that uses two entries, a combo box, two labels, and a button to do basic calculations, as shown in the images below. The combo box should have the options for addition, subtraction, and multiplication, displayed as', andrespectively. Row 0 of the layout grid must contain an entry, the combo box and another entry in columns 0...
Python 3+ (using TKinter): 1.) Develop new TKinter GUI widget class Ed that can be used to teach first-graders addition and subtraction. The GUI should contain two Entry widgets and a Button widget labeled "Enter". At start-up, your program should generate (1) two single-digit pseudorandom numbers a and b and (2) an operation op, which could be addition or subtraction—with equal likelihood—using the randrange() function in the random module. The expression a op b will then be displayed in the...
Using Python’s tkinter Graphical User Interface (GUI) module create a Python program to input the number of each type of coin a user has in their possession and then compute and display the total dollar and cents value of these coins. Your solution must accommodate Dollar, Half-Dollar, Quarter, Dime, Nickel, and Penny coins. Your solution must be robust against invalid inputs (i.e., negative value entered into any coin entry widget).
in python (27) TKinter : Draw a Stop Sign on a canvas. The Stop Sign is a regular octagon coloured red with a white STOP written in its center (28) TKinter : Write a GUI compound interest caleulator. The relevant form: P Principal in dollars to ln invested early ute of inferest uriien im decimol n mns of tones thue nterstus to be compoded cach yeur: t H: number of years the principal is ineested TP ) The biuol niterest...
Please, build calculator to exact image as below using Python. Write a GUI that implements the calculator shown in the following image: Calculator х Plus Equals: Add Clear Quit - User enters two integers into the text fields. - When Add button is pressed, the sum of the values in the text fields are shown after the Equals: as a label. - The Clear button clears the values in the text fields. The cleared values can be blank or zero....
Java: Exercise 15.9 Follow the instructions in the textbook, also shown here: 15.9 (Draw lines using the arrow keys) Write a program that draws line segments using the arrow keys. The line starts from the point (100,100) in the pane and draws toward cast, north, west, or south when the right-arrow key up-arrow key, left- arrow key, or down-arrow key is pressed, as shown in Figure 15.26b. Exercise15 09 JOlX (b) Figure 15.26 (b) Exercise 15.9 uses the arrow keys...
Design a program using Python and using from flask Import flask that generates a lottery number but in a website.. The program should have an Integer array with 9 elements. Write a loop that steps through the array, randomly generating a number in the range of 0 through 42 for each element. (Use the random function) Then write another loop that displays the contents of the array. Each number should be displayed as a list, the numbers should be generated...