cli.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:crowddynamics 作者: jaantollander 项目源码 文件源码
def simulation_commands():
    """Make commands simulations imported from python files in current working 
    directory."""
    simulations = import_simulations(dir_path='.')
    for simulation_name, simulation_cls in simulations.items():
        # New command
        command = click.Command(
            simulation_name, callback=lambda: simulation_cls().run())

        # Add the command into run group
        run.add_command(command)

        # Add options for setting up the simulation
        for name, trait in class_own_traits(simulation_cls):
            command.params.append(trait_to_option(name, trait))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号