Python Forum
tkinter and image paths
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tkinter and image paths
#1
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?
Reply
#2
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).
Reply
#3
It was the editor I am using. If I run the script in shell it works as expected. I guess atom treats path differently.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Scrollable big image in a window (TKinter) Prospekteur 3 202 Sep-14-2020, 03:06 AM
Last Post: Larz60+
  Adding an image to a tkinter window djwilson0495 2 514 Aug-23-2020, 11:07 AM
Last Post: ebolisa
  Create image on a Toplevel using tkinter ViktorWong 3 1,518 Jun-13-2020, 03:21 PM
Last Post: deanhystad
  [Tkinter] Tkinter Logo Image Evil_Patrick 1 597 May-25-2020, 05:12 AM
Last Post: DT2000
  [Tkinter] Image editor using Tkinter and PIL Raulica 2 1,231 Dec-03-2019, 10:10 PM
Last Post: joe_momma
  Unable to put background image on Tkinter Frame jenkins43 2 4,372 Nov-27-2019, 11:38 AM
Last Post: jenkins43
  Zooming a tkinter image GalaxyCoyote 2 2,848 Nov-09-2019, 04:36 PM
Last Post: GalaxyCoyote
  Can't load a png image tkinter Pythenx 2 3,883 May-04-2019, 05:43 PM
Last Post: woooee
  [Tkinter] Default Paths francisco_neves2020 13 1,371 Apr-22-2019, 08:59 PM
Last Post: francisco_neves2020
  how to insert image into Text widget Tkinter atlass218 5 4,140 Apr-17-2019, 05:28 AM
Last Post: atlass218

Forum Jump:

User Panel Messages

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