-1

Is their way to use a picture/images without it needing to be on my disk (on my computer storage). For example here is my python code

root = Tk()
root.title("Bitcoin Price")
p1 = PhotoImage(file = 'images\Btc.png')
root.iconphoto(False, p1)

As you can see if I was to move this Btc.png (or the file 'images') or rename, etc. the code won't not work.

Jaryal
  • 19
  • 5
  • 1
    It's pretty common to have programs which consist of dozens or hundreds of different files, including binary files like images… you just need to keep them together and not move them around independently willy nilly…?! – deceze Apr 15 '21 at 14:38

1 Answers1

0

Is their way to use a picture/images without it needing to be on my disk

No, while you can use things like webview.load_uri(), which just lets you select an URL as source, the file will always be downloaded and stored on your computer.

As you can see if I was to move this Btc.png (or the file 'images') or rename, etc. > the code won't not work.

With p1 = PhotoImage(file = 'images\Btc.png') you told the program that in the folder "images" is a file named "Btc.png". Now if you change the location/name of the file but not this command the program still assumes that the file is there until it tries to use it.

A-Tech
  • 806
  • 6
  • 22