Avatar ·

Diferencia entre @singledispatch y @overload

📁 python, ayuda

¿Cuál es la diferencia entre @singledispatch y @overload? ¿Con qué se hace la sobrecarga en Python?

Avatar ·

Intente así:

import tkinter as tkfrom PIL import ImageTk, Imagedef show_image(path):    root = tk.Tk()    img = Image.open(path)    width = 500    ratio = (width / float(img.size[0]))    height = int((float(img.size[1]) * float(ratio)))    imag = img.resize((width, height), Image.ANTIALIAS)    image = ImageTk.PhotoImage(imag)    panel = tk.Label(root, image=image)    panel.pack(side="top")

Inicia sesión para dejar una respuesta

Blogs