Код: Выделить всё
rootfolder
/subfolder1/
/subfolder2
/subfolder3/test.py
Код: Выделить всё
script_dir = os.path.dirname(__file__)
full_path = os.path.join(script_dir,'/subfolder1/')
Подробнее здесь: https://stackoverflow.com/questions/477 ... -directory