python loading image file requires absolute path 1

python loading image file requires absolute path

import os
# Look to the path of your current working directory
working_directory = os.getcwd()
# Or: file_path = os.path.join(working_directory, 'my_file.py')
file_path = working_directory + 'my_file.py'

Here is what the above code is Doing:
1. os.getcwd() returns the path of the current working directory.
2. os.path.join() joins the current working directory with the name of the file.
3. The + operator joins the current working directory with the name of the file.

Similar Posts