在python函数的参数中包含*

2024-10-04 05:30:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我要求在函数的参数中包含*。 但它的语法错误如下

>>> xr.bngConfig(get_topo*titan_file=self.inputs['titan_file'])
File "<stdin>", line 1
SyntaxError: keyword can't be an expression

我无法更改这里的参数,因为bngConfig正在调用一个tcl函数,该函数的-get_topo*titan_file是我无法更改的参数

python调用中如何包含*呢


Tags: 函数self参数getstdinlinefileinputs