Хочу добавить относительный путь в консольную программу на Python. (для возможности портирования на другие ПК). Пишет "No such file or directory". Абсолютный путь работает. Пытался каким-то образом изменить активную директорию, но не смог. '''
def download_fiels():
with open("../wordbooks/russian_nouns.txt", encoding='utf-8') as file:
WORD_LIST = [row.strip() for row in file]
with open("../wordbooks/russian_pril.txt", encoding='utf-8') as file:
QUALITY_LIST = [row.strip() for row in file]
with open("../wordbooks/russian_imena.txt", encoding='utf-8') as file:
NAME_LIST = [row.strip() for row in file]
return WORD_LIST, QUALITY_LIST, NAME_LIST
'''
print(os.getcwd())
для отладки.os.chdir(path)
чтобы поменять текущий каталог. Я, правда,chdir
не люблю.