#! /usr/bin/env python
import pymysql

conn = pymysql.connect(
    host="localhost",
    user="root",
    passwd="",
    db="testing",
    charset="utf8",
    use_unicode="true",
)

with conn.cursor() as cursor:
    cursor.execute(
        "SELECT empno, ename FROM emp LIMIT %s",
        (10,),
    )
    row_list = cursor.fetchall()

print(row_list)

結果

((7369, 'SMITH'), (7499, 'ALLEN'), (7521, 'WARD'), (7566, 'JONES'), (7654, 'MARTIN'), (7698, 'BLAKE'), (7782, 'CLARK'), (7788, 'SCOTT'), (7839, 'KING'), (7844, 'TURNER'))