Пример #1
0
def catchAndDisplay(cmd):
    """Catch stdout from a Python cmd and display it in a window."""
    save = sys.stdout
    try:
        f = tempfile.TemporaryFile('w+')
        sys.stdout = f
        eval(cmd)
        f.seek(0)
        draw.textView(f.read())
    finally:
        sys.stdout = save
Пример #2
0
def opengl():
    """Display the OpenGL format description."""
    draw.textView(viewport.OpenGLFormat())
Пример #3
0
def license():
    """Display the pyFormex description."""
    draw.textView(file(GD.cfg['help/license']).read())