Fork me on GitHub

Other articles


  1. A very Simple and Stupid plugin system in python

    Two convenience functions for listing and importing python modules :

    # utils.py
    
    import os
    
    def plugins_list(plugins_dirs):
        """ List all python modules in specified plugins folders """
        for path in plugins_dirs.split(os.pathsep):
            for filename in os.listdir(path):
                name, ext = os.path.splitext(filename)
                if ext.endswith(".py"):
                    yield name
    
    
    def …
    read more

    There are comments.

Page 1 / 3 »

social