Controlling kwrite by dcop

qwweeeit at yahoo.it qwweeeit at yahoo.it
Sun May 8 08:41:01 EDT 2005


Hi all,
in my cross-reference tool I have the need to highlight the variables
(by printing them in bold).
I am using the kwrite editor, and I am not able to control it from
python.
I was thinking of various solutions:
- consider the text file as html and use <b>...</b>
- use LaTex
- define a "new" language for kwrite with reserved words made up of the
cross-referenced variables (and so printed in bold).
etc..
Googling around I found:
http://phil.freehackers.org/kde/kde-techno/kde-techno-2.html

Python code to make a DCOP call
-------------------------------
#!/usr/bin/env python

from dcop import *

app = DCOPApplication("kwrite")
app.KWriteIface.insertText("This text was inserted from a python
shell!!!", 0)

app = DCOPApplication("konqueror")
app.KonquerorIface.createNewWindow("http://developer.kde.org")


As you can see you can interact with kwrite from dcop.
Unfortunately I don't have this module in my Python (2.3) nor I have
been able to find it.
Can you help me? Or have you a better solution for printing selected
parts of a text file in bold, without possibly changing the editor?




More information about the Python-list mailing list