Answer the question
In order to leave comments, you need to log in
How to load a label as an image in python tkinter?
How to load a label as an image in python tkinter?
I created a label like this:
import os, winshell
from win32com.client import Dispatch
# Соединяем пути, с учётом разных операционок.
path = os.path.join("C:\Fox.lnk")
# Задаём путь к файлу, к которому делаем ярлык.
target = 'C:\cer.gif'
# Назначаем путь к рабочей папке.
wDir = r"C:\\Users\\"
shell = Dispatch('WScript.Shell')
# Создаём ярлык.
shortcut = shell.CreateShortCut(path)
# Путь к файлу, к которому делаем ярлык.
shortcut.Targetpath = target
# Путь к рабочей папке.
shortcut.WorkingDirectory = wDi
# Обязательное действо, сохраняем ярлык.
shortcut.save()
Answer the question
In order to leave comments, you need to log in
Che? What do you want to do more? A shortcut in Windows is a file containing a structure that contains the path to the file that the shortcut refers to and other data (path to the icon, description, hint). What do you want to do when you pass a non
-image file to PhotoImage ?
In order to load the file referenced by the shortcut into PhotoImage, on the contrary, you need to read the shortcut and get the path to the file
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question