1

I im a beginner and have a question. I made an exe file of my code and everything when well. After i transported it to another computer i got a failed script error. Understandable cause i link a image on my local computer.

Do you know an easy way to link a image or import it that i can my programm with a background on other computers ?

Python 3.4

Thank u guys!

C = Canvas(frank, bg="blue", height=250, width=300)
filename = PhotoImage(file = "G:\\frankscripts\opdrachten\giphy.gif")
background_label = Label(frank, image=filename)
background_label.place(x=0, y=0, relwidth=1, relheight=1)
C.pack()
fnitty
  • 61
  • 1
  • 5
  • Which tool did you use to convert your script to an executable file? [Here](http://stackoverflow.com/questions/6689410/how-to-compile-all-resources-into-one-executable-file) somebody tries this using `PyInstaller`. – ventiseis Mar 30 '17 at 19:35
  • If the image is in the same folder as your script it is only necessary to pass a relative path: `filename = PhotoImage(file = "giphy.gif") `, and in the end you only need to place the image on the side of your executable. – eyllanesc Mar 30 '17 at 19:52
  • @ventiseis i also used pyinstaller. It seems it is indeed not possible to put it in one file. i will try your link. – fnitty Mar 30 '17 at 20:33
  • @eyllanesc thanx but i know. The problem is i only i want 1 exe file and no other files – fnitty Mar 30 '17 at 20:34

0 Answers0