Python Forum

Full Version: HELP: collect path name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I have a project with several folders with .py files. I also have some .png files which are used by open-cv.
Currently I use the following path format, to access those .png files:


So, the folder structure will be similar to below:
  • Folder 1
    • name.png
    • name2.png
    • file.py

image = show("./name.PNG", 100, 'title') where it takes the file from Folder1.

However, now I want to move the images to a different folder within the same project. The folder is called 'Images'.
The folder becomes like below:
  • Folder 1
    • file.py
  • Images
    • name.png
    • name2.png

image = show("what do I need to put here?/name.PNG", 100, 'title') where it takes the file from Images.

How can I access this folder?
show("Images/name.PNG", 100, 'title')