Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def broken():
- files = []
- file1 = os.path.join("broken_file", "rating4")
- os.listdir(file1)
- for i in os.listdir("broken_file"):
- file1 = os.path.join("broken_file", i)
- if os.path.isdir(file1):
- for j in os.listdir(file1):
- file2 = os.path.join(file1,j)
- if os.path.isdir(file2):
- for k in os.listdir(file2):
- file3 = os.path.join(file2,k)
- if os.path.isdir(file3):
- for n in os.listdir(file3):
- file4 = os.path.join(file3,n)
- if os.path.isdir(file4):
- pass
- else:
- files.append(file4)
- else:
- files.append(file3)
- else:
- files.append(file2)
- else:
- files.append(file1)
- file3 = []
- for x in files:
- if x[-5:] == ".json":
- files.append(x)
- return sort_list(files)
- broken()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement