[SOLVED] Re: Querying MariaDB from python
Tony van der Hoff
lists at vanderhoff.org
Tue Oct 2 12:30:38 EDT 2018
On 02/10/18 17:13, Larry Martell wrote:
> On Tue, Oct 2, 2018 at 12:09 PM Tony van der Hoff <lists at vanderhoff.org> wrote:
>>
>> On 02/10/18 16:47, Ervin Hegedüs wrote:
>>> hi,
>>>
>>> now rows will looks like this:
>>> ({'id':...,...},{'id':...,}...)
>>
>> Thanks Ervin, but:
>>
>> cursor = cnx.cursor(pymysql.cursors.DictCursor)
>> NameError: name 'pymysql' is not defined
>>
>> I have been using the mysql.connector module, which seems to be the
>> "official" python interface.
>
> That also supports the cursordict:
>
> https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursordict.html
>
Great, thanks Larry, that sorts it.
--
Tony van der Hoff | mailto:tony at vanderhoff.org
Buckinghamshire, England |
More information about the Python-list
mailing list