Exploratory query

Skip Montanaro skip at pobox.com
Tue Aug 5 00:02:43 EDT 2003


    Don> Would python allow me to run flist and use its output, or would I
    Don> need to re-write flist? The idea is to keep something on the screen
    Don> and poll the mailboxes every n seconds and update the display.

You can do this quite easily.  Presuming you just want to display flist's
output for now, but maybe mangle it later, you can probably get away with
something simple like this:

    import time
    import commands

    while True:
        status, output = commands.getstatusoutput("flist")
        if status != 0:
            print "flist barfed... exiting"
        # right here you could massage output
        print output
        time.sleep(300)         # five minutes

Skip





More information about the Python-list mailing list