我有一个烧瓶API调用。在这里,我有一个request.form
数据。
看起来像这样:
id = request.form['id']
username = request.form['username']
password = request.form['password']
dbname = request.form['dbname']
tablename = request.form['tablename']
我想用python将其写在一行中。我尝试过这种方式,但显示错误。
id,username,password,dbname,tablename = request.form['token','username','password','dbname','tablename']
我尝试过了。它显示错误。如何实现这一目标...我希望将其放在一行中。在python中有可能吗?
答案 0 :(得分:0)
列表理解:
GROUP BY
地图:
id, username, password, dbname, tablename = (request.form[s] for s in ('token', 'username', 'password', 'dbname', 'tablename'))