简体   繁体   English

如何显示URL图像Tkinter的Python 3

[英]How to display Url Image Tkinter python 3

How can I visualize an url of an image with tkinter (" http://images.amazon.com/images/P/0374157065.01.LZZZZZZZ.jpg ").I would like to place it in the last column of the program, in standard size, I tried many guides but none of them ever worked. 如何使用tkinter可视化图像的网址(“ http://images.amazon.com/images/P/0374157065.01.LZZZZZZZ.jpg ”)。我想将其放置在程序的最后一栏中,标准尺寸,我尝试了许多指南,但没有一个起作用。 Thanks very mutch 非常感谢

Why not bind a URL to a Label like this? 为什么不将URL绑定到这样的标签?

from tkinter import *
import webbrowser

def callback(event):
    webbrowser.open_new(r"http://www.your-image.com")

root = Tk()
link = Label(root, text="The image", fg="blue", cursor="hand2")
link.pack()
link.bind("<Button-1>", callback)
root.mainloop()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM