import os import glob for f in glob.glob("../MiniChain/examples/*.py"): name = f.split("/")[-1].split(".")[0] print(name, f)