我的问题是为什么MySQL行的整数值有一个"L"后缀?详情如下:
下面的字典——为了便于显示,在这里人工设置了格式--
{'estimated': '',
'suffix': '',
'typeofread': 'g',
'acct_no': 901001000L,
'counter': 0,
'time_billed': datetime.datetime(2012, 5, 1, 9, 5, 33),
'date_read': datetime.datetime(2012, 3, 13, 23, 19, 45),
'reading': 3018L,
'meter_num': '26174200'}
由MySQL数据库表的列组成,这些列压缩了从表中读取一次的结果.
我可以通过将这些值传递到int()中来删除"L",因此,如果该字典位于名为snaped_read的变量中,我可以这样做:
int(snapped_read['reading'])
和3018L
将变为3018
.
我只是好奇为什么整数会这样出现.