#假设我们有一个变量名为test
the_string = "test"
the_var = locals()[the_string]
#这个时候test的值就赋给了the_var
python 字符串转变量
猜你喜欢
转载自blog.csdn.net/AaronPaul/article/details/82965178
今日推荐
周排行