Python Forum
tkinter and image paths
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tkinter and image paths
In the project I'm working on, I have to put full paths to images starting from the root directory. Does tkinter not start the path in the working directory?
Example (/home/user/path/to/image.png)
I don't understand why ./image.png does not work. Image.png is in the same directory. Is it because it's not in the python path?
If it is in the same directory, you should be able to just refer to the file by its name "image.png" (no need for the './' in front of it).
It was the editor I am using. If I run the script in shell it works as expected. I guess atom treats path differently.

Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter: Image to Label Maryan 10 202 Oct-29-2020, 01:48 PM
Last Post: joe_momma
  Scrollable big image in a window (TKinter) Prospekteur 3 214 Sep-14-2020, 03:06 AM
Last Post: Larz60+
  Adding an image to a tkinter window djwilson0495 2 546 Aug-23-2020, 11:07 AM
Last Post: ebolisa
  Create image on a Toplevel using tkinter ViktorWong 3 1,532 Jun-13-2020, 03:21 PM
Last Post: deanhystad
  [Tkinter] Tkinter Logo Image Evil_Patrick 1 609 May-25-2020, 05:12 AM
Last Post: DT2000
  [Tkinter] Image editor using Tkinter and PIL Raulica 2 1,248 Dec-03-2019, 10:10 PM
Last Post: joe_momma
  Unable to put background image on Tkinter Frame jenkins43 2 4,411 Nov-27-2019, 11:38 AM
Last Post: jenkins43
  Zooming a tkinter image GalaxyCoyote 2 2,866 Nov-09-2019, 04:36 PM
Last Post: GalaxyCoyote
  Can't load a png image tkinter Pythenx 2 3,897 May-04-2019, 05:43 PM
Last Post: woooee
  [Tkinter] Default Paths francisco_neves2020 13 1,385 Apr-22-2019, 08:59 PM
Last Post: francisco_neves2020

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020