I have a python code that accesses mysql through MySQLdb to run a select statement. I then use cursor.fetchall()
to gather that output as an array, but the problem is it prints an L
at the end of each output like so:
sql = "SELECT data1, data2 FROM table1, table2 ;"
cursor.execute(sql)
dataarray = cursor.fetchall()
print dataarray
>>> ((75379L, 45708L), ...)
But in my table, there are no L's, just the numbers. How can I ensure that it just fetches and prints the data without the L? I'd rather avoid using [:-1]
on a string because then it changes my None
values to Non
.