I am playing with the tkinter
library and actually having the code, where I don’t understand what is a text
value in text=text
. It is seemingly connected with the text
attribute of the show_popup
function because if I rename it, it doesn’t work properly. I would expect to find it in tkinter
help, but I wasn’t able to find it there.
import tkinter as tk
popup = tkinter.Tk()
def show_popup(text):
popup = tk.Tk()
popup.geometry("300x150")
popup.title("Krávy útočí!")
label = tk.Label(popup, text=text)
label.pack()
close_button = tk.Button(popup, text="Spláchnout", command=popup.destroy)
close_button.pack()
popup.mainloop()
a, b, c, d, e, f, g, h, i, j, k = "(", "_", ")", "o", "/", "-", "\\", "|", "*", " ", "\n"
text_to_display = "".join([j * 11, a, b * 2, c, k, j * 11, a, d * 2, c, k, j*4, e, f*7, g, e, k, j*3, e, h, j*7, h*2, k, j*2, i, j, h, j*7, h*2, k])
show_popup(text_to_display)