首页 > 解决方案 > Python:函数调用作为参数

问题描述

我想做一个函数:

def func (model_name = 'abc', **kwargs):
  model = model_name (**kwargs)
  model.do_something ()

因此模型将根据参数的值创建model_name

标签: python-3.x

解决方案


推荐阅读