阅读背景:

在没有eval的情况下,在Python 3中安全地解析用户定义的方程式

来源:互联网 

I have a number of variables in my code such as STA, INT, AGI and dmg_taken, and want the dmg_taken to be calculated by a user defined equation. As a proof of concept I used eval, and this works as follows.I have a number of variables in my code such as




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: