TY
Size: a a a
TY
I
V
Traceback (most recent call last):вот сам код функции:
File "E:\PycharmProjects\pythonProject2\myproject\testing.py", line 18, in <module>
print(get_json_files())
File "E:\PycharmProjects\pythonProject2\myproject\testing.py", line 15, in get_json_files
with open(json_name, 'r') as jsons:
FileNotFoundError: [Errno 2] No such file or directory: 'file.json'
def get_json_files():что я не так делаю? я не понимаю, как про инициировать папку с файлами и отдать ее в функцию которая примет в себя данные
thisdir = r'E:\PycharmProjects\pythonProject2\data'
list_json = []
for r, d, f in os.walk(thisdir):
for file in f:
if file.endswith(".json"):
with open(file, 'r') as jsons:
list_json.append(json.loads(jsons.read()))
return list_json
print(get_json_files())
A
A
TY
class HTTPDigestAuth(AuthBase):
"""Attaches HTTP Digest Authentication to the given Request object."""
def __init__(self, username, password):
self.username = username
self.password = password
# Keep state in per-thread local storage
self._thread_local = threading.local()
TY
AT
TY
СВ
TY
М
A
TY
TY
TY
A
AT
TY