I'm trying to make a python program which uses python to interact with MySQL. What I want to do is to have the program return and store into a variable the return of that command variable.
For example, if I entered into the MySQL command line SHOW tables;
, it would show me all the tables, and it would look something like this:
+----------------+
| Tables_in_test |
+----------------+
| food |
| games |
| movies |
+----------------+
I want to know if there's any way to get that output into, for instance, a variable in python.
Thanks!