-2
我retriving从PSQL数据库中的数据,我得到像我下面的值:的Python:从列表中获取值
list = [('value1','value2')]
我要存储在两个不同的变量VAR1值和VAR2象下面这样:
var1 = 'value1'
var2 = 'value2'
我该如何做到这一点?
我试图做到这一点象下面这样:
var1 = list[0][0]
var2 = list[0][1]
print var1 (gives me the output value1 and not 'value1')
print var2 (gives me the output value2 and not 'value2')
在shell中,所有的字符串都会输出而没有引号,所以一切正常...... – Vladyslav
'print(type(var1))'如果它说的字符串你很好去。 –
你想要在报价周围显示报价? ''print +''“' – cdarke