clear console and clear report by python

Need help, or want to share a macro? Post here!
User avatar
bernd
Posts: 7757
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

clear console and clear report by python

Postby bernd » Fri Feb 20, 2015 11:31 am

Is there a possobility to clear the python console and/or report view by python?
Last edited by bernd on Fri Feb 20, 2015 6:33 pm, edited 1 time in total.
wmayer
Site Admin
Posts: 14287
Joined: Thu Feb 19, 2009 10:32 am

Re: clear console and clear report by pyhton

Postby wmayer » Fri Feb 20, 2015 11:43 am

Code: Select all

from PySide import QtGui
mw=Gui.getMainWindow()

c=mw.findChild(QtGui.QPlainTextEdit, "Python console")
c.clear()

r=mw.findChild(QtGui.QTextEdit, "Report view")
r.clear()
User avatar
bernd
Posts: 7757
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: clear console and clear report by python

Postby bernd » Mon Feb 23, 2015 10:27 pm

Thanks Werner! :)