我的问题是为什么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’,因此如果该字典位于名为snapped_read的变量中,我可以这样做:
int(snapped_read [‘reading’])和3018L将更改为3018。
我只是好奇为什么整数以这种方式出现。