def call_graphivz_script(script):
    """Shows a graph using dot and eog."""
    from tempfile import NamedTemporaryFile
    from subprocess import Popen, PIPE
    dotcmd = ['dot', '-Tpng']
    dotproc = Popen(dotcmd, stdin=PIPE, stdout=PIPE)
    out, err = dotproc.communicate(script)
    if out:
        with NamedTemporaryFile(suffix='.png') as tmpf:
            tmpf.write(out)
            tmpf.flush()
            Popen(['eog', tmpf.name]).wait()
