Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
import tkinter as tk main_window = tk.Tk() main_window.geometry("520x580") def on_click(key: str): print(f"Click on: {key}") for i in range(4): main_window.grid_rowconfigure(i, weight=1, uniform="rows") main_window.grid_columnconfigure(i, weight=1, uniform="cols") columna_letras:list[str] = ['A', 'B', 'C', 'D'] tarjetas:dict[str, tk.Button] = {} for fila in range(4): for columna in range(1, 4+1): clave = f"{columna_letras[fila]}{columna}" boton = tk.Button(main_window, text=clave, command=lambda k=clave:on_click(k)) boton.grid(row=fila, column=columna-1, sticky="nsew", padx=6, pady=6) tarjetas[clave] = boton main_window.mainloop()
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)