Logo Search packages:      
Sourcecode: pymol version File versions

xwin.py


import os

def machine_get_clipboard():
    result = []
    from popen2 import popen2
    wish_path = os.environ['PYMOL_PATH']+"/ext/bin/wish8.0" # dubious...
    if not os.path.exists(wish_path):
        wish_path = "/usr/bin/wish"
    if os.path.exists(wish_path):
        pipe = popen2(wish_path)
        pipe[1].write("puts [ selection get ]\n")
        pipe[1].write("exit\n")
        pipe[1].close()
        while 1:
            l=pipe[0].readline()
            if not l: break
            result.append(l)
    return result

                      
    

Generated by  Doxygen 1.6.0   Back to index