I Selected my needed Data Like This:
import pathlib
from pathlib import Path
import glob, os
folder = Path('D:/xyz/123/Files')
os.chdir(folder)
for file in glob.glob("*.json"):
JsonFiles = os.path.join(folder, file)
print (JsonFiles)
As Output I will get all my needed .json Files
D:/xyz/123/Files/Data.json
D:/xyz/123/Files/Stuff.json
D:/xyz/123/Files/Random.json
D:/xyz/123/Files/Banana.json
D:/xyz/123/Files/Apple.json
For my further coding in need a Variable to the diffrens Json Paths. So my Idear was insted of printing them to store them in a List. But thats not working?
ListJson =[JsonFiles]
print (ListJson[1])
I get this Error:
print (ListJson[2])
IndexError: list index out of range
How wold you solve this Problem I just need an possibility to work with the Paths I already sorted.