I'm using VS Code to program in Python. Instead of copying and pasting an image (or any other type of file) from one directory to the same directory my .py file is located in, I want to reference that image instead even if it's in a different directory. Or, at least, make that directory's path accessible from my program.
This is how my folders are structured.
- MainFolder
- AssetsFolder
- image.jpg
- file.py
I tried:
import sys
sys.path.append('C:\User\myname\MainFolder\AssetsFolder\')
But it didn't seem to work.