clear console and clear report by python
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
clear console and clear report by python
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.
Re: clear console and clear report by pyhton
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()
Re: clear console and clear report by python
Thanks Werner!
- FredCailloux
- Posts: 52
- Joined: Wed Jul 14, 2021 7:37 pm
- Location: Canada
Re: clear console and clear report by python
I'm a beginner with FreeCAD and Python.
Since there doesn't seem to be an existing simple command to clear the Python console screen, like "cls" or "clear"
Is there a way to program a CTRL-mykey such that it will execute these code lines ?
Can such CTRL-mykey be saved permanently such that it remain available in the Python console at FreeCAD startup ?
Since there doesn't seem to be an existing simple command to clear the Python console screen, like "cls" or "clear"
Is there a way to program a CTRL-mykey such that it will execute these code lines ?
Code: Select all
c=mw.findChild(QtGui.QPlainTextEdit, "Python console")
c.clear()
Great results only comes with great understanding. Great memory is just an illusion.
Re: clear console and clear report by python
The Python console has a (right-click) context menu with a "Clear" option.