Quantcast
Channel: Nomad Journey
Viewing all articles
Browse latest Browse all 20

Suppressing MySQL/MySQLdb warning messages from Python

$
0
0
Here is a quick three line snippet that will suppress all of those annoying warning messages from MySQL when using MySQLdb: from warnings import filterwarnings import MySQLdb as Database filterwarnings('ignore', category = Database.Warning) To re-enable the warnings later on: from warnings import resetwarnings resetwarnings() More about the warnings Python standard library: http://docs.python.org/library/warnings.html

Viewing all articles
Browse latest Browse all 20

Trending Articles