FYI tip or trick: script to clear PythonWIn interactive window

156 views
Skip to first unread message

Lew.Gr...@gov.bc.ca

unread,
Mar 10, 2014, 12:21:43 PM3/10/14
to geop...@googlegroups.com
Hi Everyone,
 
This post related to clearing the Interactive Window prior to running a script PythonWin ( sorry Tarkenton but I like using).
 
#clear Pythonwin Interactive screen
import subprocess
def cls():             
  doc=subprocess.sys.stdout.GetDocument()
  Editor=doc.GetEditorView()
  Editor.SetSel(-1,0)
  Editor.ReplaceSel("")
 
Thanks
Lew

rebenci...@gmail.com

unread,
May 20, 2015, 4:24:30 AM5/20/15
to geop...@googlegroups.com, Lew.Gr...@gov.bc.ca
Hi!

You have no idea how much I've been searching for a solution on this..issue.
Thanks a lot: it work flawlessly!
Reply all
Reply to author
Forward
0 new messages