Escaping confusion with Python 3 + MySQL

Νίκος Βέργος me.on.nzt at gmail.com
Mon Mar 27 05:03:18 EDT 2017


Thank you very much Johann.

i was using print(update wuery here) and i was seeing that print was able
to parser the query and that consused me as to why execute wont do the same
since with print all values was gettign substituted.

of course pymysql doesnt behave the same with print but until i fugure that
out cost me lots of time.

Στις Δευ, 27 Μαρ 2017 στις 10:52 π.μ., ο/η Johann Spies <
johann.spies at gmail.com> έγραψε:

> Νίκος,
>
> I am glad that you solved the problem.
>
> I am not using mysql but postgresql.  When I get a problem using python to
> communicate with the database, one of my first steps will be to determine
> whether the error is a python (maybe psycopg-related) related error or a
> database error.  What I do then is to use the string python is sending to
> the database and try to run that on the commandline interface to the
> database (psgl) or something like pgadmin3.  Mysql have similar tools.
>
> Once you have determined that it a database related problem, it should be
> easy to sort it out on that side.  If it works on the database the rest of
> the problem should be solved on the python side.
>
> Maybe this approach would have saved you some time.
>
> Regards
> Johann
> --
> Because experiencing your loyal love is better than life itself,
> my lips will praise you.  (Psalm 63:3)
>
-- 
What is now proved was at first only imagined!


More information about the Python-list mailing list