Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Surpressing Warnings

1 view
Skip to first unread message

Chris Rebert

unread,
Aug 9, 2009, 6:47:58 PM8/9/09
to Victor Subervi, pytho...@python.org
On Sun, Aug 9, 2009 at 4:21 PM, Victor Subervi<victor...@gmail.com> wrote:
> Hi:
> I get a ton of warnings like this from a program I run:
>
> Warning (from warnings module):
>   File "C:\Python25\read.py", line 67
>     cursor.execute(sqlKWDrop)
> Warning: Unknown table 'judaism_128'
>
> How do I surpress them?

import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
cursor.execute(sqlKWDrop)
#repeat for every call that's causing warnings

or to just silence all warnings from anywhere:

import warnings
warnings.simplefilter("ignore")

Cheers,
Chris
--
http://blog.rebertia.com

Message has been deleted
Message has been deleted
0 new messages