import json
from os import listdir
from os.path import isdir

with open("menu.json", "w") as fp:
    json.dump(
        {
            d: sorted(listdir(d))
            for d in listdir()
            if isdir(d) and not d.startswith(".")
        },
        fp,
        sort_keys=True,
        indent=4,
    )

33efd8117e609ea7d4f71f3d871162c4a403dd65
<mask token>

<mask token>
with open('menu.json', 'w') as fp:
    json.dump({d: sorted(listdir(d)) for d in listdir() if isdir(d) and not
        d.startswith('.')}, fp, sort_keys=True, indent=4)

import json
from os import listdir
from os.path import isdir
with open('menu.json', 'w') as fp:
    json.dump({d: sorted(listdir(d)) for d in listdir() if isdir(d) and not
        d.startswith('.')}, fp, sort_keys=True, indent=4)

import json
from os import listdir
from os.path import isdir

with open("menu.json", "w") as fp:
    json.dump(
        {
            d: sorted(listdir(d))
            for d in listdir()
            if isdir(d) and not d.startswith(".")
        },
        fp,
        sort_keys=True,
        indent=4,
    )
