lofidevops
lofidevops

Reputation: 16932

How can I clear the Maya Script Editor programatically?

While creating and debugging scripts, I generate lots of feedback for myself, but if I don't clear the Script Editor, I can get confused about which attempt the feedback I'm looking at came from.

Is there a way (preferably with PyMEL, but MEL is ok) to clear the Script Editor History?

Upvotes: 5

Views: 2647

Answers (1)

theodox
theodox

Reputation: 12208

Try:

cmds.scriptEditorInfo(ch=True)

Or (PyMEL version):

import pymel.core as pm
pm.scriptEditorInfo(clearHistory=True)

You should also take a look at python's built-in logging module. It allows you to define logging formatters which include the file name and line number where the log message was generated so you can see precisely where things came from.

Upvotes: 7

Related Questions