可能重复:
在 Python 中动态设置局部变量
我试图执行这个:
# the request send a number and its ok, the variable have good informations.
test = request.POST[member.user.username]
# SyntaxError at ***here***, can't assign to operator
group%d % test = member.user.username
我也试过:
test = request.POST[member.user.username]
group%d = member.user.username % test
和 :
test = request.POST[member.user.username]
group%d = member.user.username % (test)
对语法有什么想法吗?