I am a newbie at Python, and wading through the various peculiarities of the language. One of the peculiarity I found is the output of the following code snippet:
qry = 'SELECT COUNT(*) FROM <<TABLE>>'
cursor.execute(qry)
rowCounts = cursor.fetchone()
print("The number of rows in the <<TABLE>> table : {}".format(rowCounts))
I am getting the following output on my terminal:
Connected to the MySQL database.
The number of rows in the <<TABLE>> table : (150L,)
I am stumped by the brackets and the comma. I have searched for the answer to explain the occurrence, but haven't found any plausible explanation for the format. Is there something I should be doing differently?
All help is appreciated.
type(rowCounts)andtype(rowCounts[0])? I suspect it's a tuple containing a Long