Convert String to Object name

前端 未结 2 1829
失恋的感觉
失恋的感觉 2021-01-05 07:18

I needed help on this one. How do I convert a string into a variable/object/instance name, since I don\'t know how to categorize this.
Assuming my code is:

<         


        
2条回答
  •  误落风尘
    2021-01-05 07:23

    It's been forever since I've done anything with Python but I do remember having this problem once. I suggest you look into the eval() function.

提交回复
热议问题