![](/img/trans.png)
[英]Python: define arguments of a function which include the arguments of the other function
[英]Include * in arguments to a function for 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調用中?
xr.bngConfig(**{'get_topo*titan_file': self.inputs['titan_file']})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.