код
import os, json
ar = []
with open('user_list.txt', encoding = 'utf-8' ) as r:
for i in r:
n = i.lower().split('\n')[0]
if n != '':
ar.append(n)
with open('user_list.json', 'w', encoding = 'utf-8') as e:
json.dump(ar, e)
ошибка
Traceback (most recent call last):
File "c:\Users\havra\Desktop\json_crlist.py", line 5, in <module>
with open('user_list.txt', encoding = 'utf-8' ) as r:
FileNotFoundError: [Errno 2] No such file or directory: 'user_list.txt'
файл с кодом и файл с списком в одной дериктории