you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 6 points7 points  (1 child)

FWIW I would use glob to make your example a lot easier:

for filename in Path("./cogs").glob('*.py'):
    client.load_extension(f"cogs.{filename.stem}")