TextPad and Python

Anton Vredegoor anton at vredegoor.doge.nl
Sat Mar 8 16:33:21 EST 2003


On Fri, 07 Mar 2003 23:41:51 GMT, "Neil Hodgson"
<nhodgson at bigpond.net.au> wrote:

>   SciTE's interactive output window isn't all that interactive as, for
>example, the backspace key is interpreted within the window and not sent
>through to the running program.

Maybe it's a feature :-).

At the moment I am sitting in front of 3 monitors, each connected to a
different computer. The computers are connected via network cards. I
have a mouse and a keyboard connected to a little switch box so I can
control which computer is receiving mouse and keyboard input.

Now it would be nice to read the news on one monitor, edit a script on
another monitor and have the output of the script on the third
monitor. I guess on unix this would be easy but on windows it's a lot
harder. (I probably reinvented the wheel as the next poster will
kindly point out.)

However scite is very good for these kind of things!

On one computer I have scite running a little XMLRPC script:
(the script has its output window maximized)

#echoserver.py
import SocketServer
from SimpleXMLRPCServer import SimpleXMLRPCServer

def echo(s):
    print s,
    return s

if __name__ == '__main__':
    server = SimpleXMLRPCServer(("dummy", 8000))
    server.register_function(echo)
    server.serve_forever()

(this could also be a cygwin rxvt window running the python script)

One another computer I have this script somewhere:

#echoclient.py
import xmlrpclib
import os
import sys

svr = xmlrpclib.Server('http://dummy:8000')

def runcmd(cmd):
    i,f = os.popen4(cmd)
    d = svr.echo(f.read())

if __name__=='__main__':
    runcmd('pythonw -u %s' %sys.argv[1])

The finishing touch is to have a scite on this second computer that
has this extra info in its python.properties:

    command.name.2.*.py=net echo
    command.2.*.py=pythonw -u echoclient.py $(FileNameExt)

Now if I am editing a python script there's an extra menu option under
'tools' that runs the script and displays the output on the computer
running the server script. So the output is on another monitor.

Also, not so long ago I configured scite to run the mingw c-compiler
for c-files, had pychecker installed as another menu option etc.

Of course these things could also be done using cygwin or some other
way, but scite doesn't fix things too much for me and it's very
configurable.

Scite rocks !

Anton.

whishlist:

- now if somebody would just write a python lexer-generator for scite,
I have some IRC-logs that could use better syntax coloring ...
- recursive grepping 




More information about the Python-list mailing list