2013-12-20 2 views
2

을 억제 터미널 홍수와 방법 : 충분히파이썬 + GTK는 - 내 파이썬 프로그램을 실행하면, 경고

rcGUI.py:331: Warning: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised 
label1 = gtk.Label("Current tools configured:") 
rcGUI.py:286: Warning: Attempt to add property GtkSettings::gtk-scrolled-window-placement after class was initialised 
scroll_window = gtk.ScrolledWindow() 
rcGUI.py:291: DeprecationWarning: use gtk.TreeView 
infoList = gtk.CList(2, ["Tool" , "Version"]) 
rcGUI.py:291: Warning: Attempt to add property GtkSettings::gtk-button-images after class was initialised 
infoList = gtk.CList(2, ["Tool" , "Version"]) 
rcGUI.py:217: Warning: Attempt to add property GtkSettings::gtk-can-change-accels after class was initialised 
toolCombo = gtk.combo_box_entry_new_text() 
rcGUI.py:217: Warning: Attempt to add property GtkSettings::gtk-menu-popup-delay after class was initialised 
toolCombo = gtk.combo_box_entry_new_text() 
rcGUI.py:217: Warning: Attempt to add property GtkSettings::gtk-menu-popdown-delay after class was initialised 
toolCombo = gtk.combo_box_entry_new_text() 
rcGUI.py:217: Warning: Attempt to add property GtkSettings::gtk-entry-select-on-focus after class was initialised 
toolCombo = gtk.combo_box_entry_new_text() 
rcGUI.py:217: Warning: Attempt to add property GtkSettings::gtk-entry-password-hint-timeout after class was initialised 
toolCombo = gtk.combo_box_entry_new_text() 

흥미 KDE에서 실행 내 사용자는 사용 중단 제외한 모든 경고를 (하지 않습니다), 그놈의 경우는 그렇습니다. 그래서 가장 쉬운 방법은 모든 경고를 억제하는 것입니다. 나는 아직 방법을 찾을 수 없었습니다.

+2

관련 토론 : https://mail.gnome.org/archives/commits-list/2013-April/msg07206.html – Anonimista

답변

1
import warnings 
warnings.filterwarnings("ignore") 

는 필터 해제하기 :

warnings.filterwarnings("default")