Using ast and whitelists to make python's eval() safe?

后端 未结 2 1684
醉话见心
醉话见心 2021-02-04 18:23

OK. I know the experts have spoken and you should not ever use python\'s eval() on untrusted data, ever. I\'m not smarter than the rest of the world, and s

2条回答
  •  醉话见心
    2021-02-04 19:10

    Try asteval, seems like the thing you need. Otherwise there is this safe eval

提交回复
热议问题