0

I made a GUI app with Tkinter and converted it to .exe. I need to send the application file to someone, however, I'm wondering how the script will be able to find the .ico file if the script is being executed on another computer (the person I need to send the file to tried opening the file and gets a "Failed to execute script" error).

This is the code where I make the icon:

main.iconbitmap(r'C:/Users/Joelly/MyProject/dist/MyIcon.ico')
sjoelly
  • 147
  • 2
  • 11
  • 1
    You have to send the folder to the person which has the icon and the exe and use relative path for the icon, like `main.iconbitmap('MyIcon.ico')` – Delrius Euphoria Sep 25 '20 at 13:55
  • @CoolCloud thanks for your response. Do you know if there's a way to do it that doesn't require sending a folder? – sjoelly Sep 25 '20 at 13:57
  • 1
    Take a look [here](https://stackoverflow.com/questions/51060894/adding-a-data-file-in-pyinstaller-using-the-onefile-option) – Delrius Euphoria Sep 25 '20 at 14:08
  • 1
    @CoolCloud the folder suggestion worked! Thanks. And I'll take a look at the link, thanks for sending. – sjoelly Sep 25 '20 at 14:14

0 Answers0