Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pathlib import Path
- from tkinter import Tk, Canvas, Entry, Text, Button, PhotoImage,messagebox
- import time, os ,sys
- OUTPUT_PATH = Path(__file__).parent
- ASSETS_PATH = OUTPUT_PATH / Path("./assets/final")
- def relative_to_assets(path: str) -> Path:
- return ASSETS_PATH / Path(path)
- def votado():
- messagebox.showinfo("Voto Registrado", "Gracias, su voto ah sido registrado.")
- time.sleep(5)
- sys.exit(0)
- window = Tk()
- window.geometry("1440x1024")
- window.configure(bg = "#FFFFFF")
- window.title("Sistema de votación")
- canvas = Canvas(
- window,
- bg = "#FFFFFF",
- height = 1024,
- width = 1440,
- bd = 0,
- highlightthickness = 0,
- relief = "ridge"
- )
- canvas.place(x = 0, y = 0)
- image_image_1 = PhotoImage(
- file=relative_to_assets("image_1.png"))
- image_1 = canvas.create_image(
- 720.0,
- 512.0,
- image=image_image_1
- )
- canvas.create_text(
- 76.0,
- 66.0,
- anchor="nw",
- text="Sistema de votación",
- fill="#FFFFFF",
- font=("Roboto Bold", 22 * -1)
- )
- canvas.create_text(
- 1051.0,
- 648.0,
- anchor="nw",
- text="Opcion 3",
- fill="#FFFFFF",
- font=("Roboto Bold", 22 * -1)
- )
- button_image_1 = PhotoImage(
- file=relative_to_assets("button_1.png"))
- button_1 = Button(
- image=button_image_1,
- borderwidth=0,
- highlightthickness=0,
- command=votado,
- relief="flat"
- )
- button_1.place(
- x=945.0,
- y=692.0,
- width=300.0,
- height=75.0
- )
- image_image_2 = PhotoImage(
- file=relative_to_assets("image_2.png"))
- image_2 = canvas.create_image(
- 1086.0,
- 415.0,
- image=image_image_2
- )
- canvas.create_text(
- 685.0,
- 648.0,
- anchor="nw",
- text="Opcion 2",
- fill="#FFFFFF",
- font=("Roboto Bold", 22 * -1)
- )
- button_image_2 = PhotoImage(
- file=relative_to_assets("button_2.png"))
- button_2 = Button(
- image=button_image_2,
- borderwidth=0,
- highlightthickness=0,
- command=votado,
- relief="flat"
- )
- button_2.place(
- x=579.0,
- y=692.0,
- width=300.0,
- height=75.0
- )
- image_image_3 = PhotoImage(
- file=relative_to_assets("image_3.png"))
- image_3 = canvas.create_image(
- 720.0,
- 415.0,
- image=image_image_3
- )
- canvas.create_text(
- 319.0,
- 648.0,
- anchor="nw",
- text="Opcion 1",
- fill="#FFFFFF",
- font=("Roboto Bold", 22 * -1)
- )
- button_image_3 = PhotoImage(
- file=relative_to_assets("button_3.png"))
- button_3 = Button(
- image=button_image_3,
- borderwidth=0,
- highlightthickness=0,
- command=votado,
- relief="flat"
- )
- button_3.place(
- x=213.0,
- y=692.0,
- width=300.0,
- height=75.0
- )
- image_image_4 = PhotoImage(
- file=relative_to_assets("image_4.png"))
- image_4 = canvas.create_image(
- 354.0,
- 415.0,
- image=image_image_4
- )
- image_image_5 = PhotoImage(
- file=relative_to_assets("image_5.png"))
- image_5 = canvas.create_image(
- 720.0,
- 981.0,
- image=image_image_5
- )
- canvas.create_text(
- 30.0,
- 968.0,
- anchor="nw",
- text="Creado por : Nicolas Pinilla, Cristian Lema, Diego ochoa, Carlos Ramos",
- fill="#000000",
- font=("Roboto Bold", 22 * -1)
- )
- window.resizable(False, False)
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement