擅长:python、mysql、java
<p>您可以使用<code>eval()</code>函数来计算代码,但您需要小心使用该函数!否则,您可能会看到<a href="https://stackoverflow.com/questions/1176136/convert-string-to-python-class-object">post</a>。另一种解决方案是预先定义允许的类型,并使用<code>typeConstructor</code>在字典映射<code>typeName</code>中收集它们。在</p>