python有一个内置函数eval(),可以将字符串进行运行. 通过help(eval)查看帮助文档 Help on built-in function eval in module builtins: eval(source, globals=None, locals=None, /) Evaluate the given source in the context of globals and locals. The source may be a string representing a…