Question
kindly use python, put code screenshots and graphs. Develop a GUI that simulates the movement of a vehicle through different components. For this work we
kindly use python, put code screenshots and graphs.
Develop a GUI that simulates the movement of a vehicle through different components. For this work we will consider a geometric figure (for example rectangle) as a vehicle. You must develop the following functions:
Initially the movement is done through a combobox component with 5 options that goes from one to five, one being the initial position and five the final position.
Another movement option is given by a text box (Entry) where we can enter the value between 1 and 5, if we do not enter those values, an exception will be generated notifying that it is not a correct value and you must clear the box of text for you to enter the value in the correct range.
In addition, for the simulation of the movement of the vehicle with the keyboard set the keys A to backwards and D to forwards.
This code that I give you is as a guide so that you can help me with the code that I need (it's like help, it's in Spanish, but it's just a guide!!!)
from tkinter import * from tkinter import ttk from tkinter import Menu from tkinter import messagebox ### creacion de la pantalla principal win=Tk() win.title("Sistema de ascensor") win.resizable(False,False) win.config(bg="blue") win.geometry("700x700") ############# funcion para el mensaje del autor def _msgBox(): messagebox.showinfo('Informacion de Creador', 'Programacion orientada a objetos ' ' Prueba segundo parcial ' ' Joel Calderon') def info(): messagebox.showinfo('Informacion programa','El programa simulador consiste en que el usuario especifica un nmero de piso y el ascensor se mueva al piso elegido' ) ### funcion para reinciar programa def _reiniciar(): messagebox.showinfo('Mensaje de Aviso','Has reiniciado el programa') var=0 ### funcion salir def quit(): win.quit() win.destroy() exit() ## Creacion Variable de control Frame10=Frame() Frame10.pack() Frame10.config(bg="sky blue") Frame10.config(bd=5) Frame10.config(relief="groove") Frame10.config(width="350", height="400") Frame10.place(x=20,y=90) #############3 Frame0=Frame() Frame0.pack() Frame0.config(bg="sky blue") Frame0.config(bd=5) Frame0.config(relief="groove") Frame0.config(width="230", height="70") Frame0.place(x=510,y=50) Frame1=Frame() Frame1.pack() Frame1.config(bg="sky blue") Frame1.config(bd=5) Frame1.config(relief="groove") Frame1.config(width="230", height="70") Frame1.place(x=510,y=130) Frame2=Frame() Frame2.pack() Frame2.config(bg="sky blue") Frame2.config(bd=5) Frame2.config(relief="groove") Frame2.config(width="230", height="70") Frame2.place(x=510,y=210) Frame3=Frame() Frame3.pack() Frame3.config(bg="sky blue") Frame3.config(bd=5) Frame3.config(relief="groove") Frame3.config(width="230", height="70") Frame3.place(x=510,y=290) Frame4=Frame() Frame4.pack() Frame4.config(bg="sky blue") Frame4.config(bd=5) Frame4.config(relief="groove") Frame4.config(width="230", height="70") Frame4.place(x=510,y=370) Frame5=Frame() Frame5.pack() Frame5.config(bg="sky blue") Frame5.config(bd=5) Frame5.config(relief="groove") Frame5.config(width="230", height="70") Frame5.place(x=510,y=450) Frame6=Frame() Frame6.pack() Frame6.config(bg="sky blue") Frame6.config(bd=5) Frame6.config(relief="groove") Frame6.config(width="230", height="70") Frame6.place(x=510,y=530) Frame7=Frame() Frame7.pack() Frame7.config(bg="sky blue") Frame7.config(bd=5) Frame7.config(relief="groove") Frame7.config(width="230", height="70") Frame7.place(x=510,y=610) ########## #botones etiqueta1=Label(text="ELEVADOR",font=("Times",20),bg="sky blue").place(x=520,y=10) entrada= StringVar() entrada.set("") etiqueta1=Label(text="BOTONES",font=("Times",20),bg="sky blue").place(x=130,y=50) entrada= StringVar() entrada.set("") #### creacion de menu root=Tk() frame=Frame(win) menu_bar=Menu(win) win.config(menu=menu_bar) file_menu= Menu(menu_bar) menu_bar.add_cascade(label="Inicio", menu=file_menu) file_menu.add_command(label="Reiniciar", command=_reiniciar) file_menu.add_command(label="Salir", command=quit) help2_menu=Menu(menu_bar,tearoff=0) menu_bar.add_cascade(label="Acerca de..", menu=help2_menu) help2_menu.add_command(label="Autor", command=_msgBox) help3_menu=Menu(menu_bar,tearoff=0) menu_bar.add_cascade(label="Ayuda", menu=help3_menu) help3_menu.add_command(label="Info", command=info) ttk.Label(win, text="UNIVERSIDAD POLITECNICA SALESIANA",font=("Arial Black",12)).place(x=20, y=12) ## AGREGAR BOTONES DE FUNCIONALIDAD win.mainloop()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started