]> git.lyx.org Git - lyx.git/blob - lib/scripts/gnuplot2pdf.py
Fix caret painting
[lyx.git] / lib / scripts / gnuplot2pdf.py
1 #!/usr/bin/python
2
3 from subprocess import Popen, PIPE
4 from sys import argv, stderr, exit
5 import os
6 import shutil
7
8 if (len(argv) != 3):
9     stderr.write("Usage: %s <src_file> <dst_file>\n" % argv[0])
10     exit(1)
11
12 with open(argv[1], 'rb') as fsrc:
13     subproc = Popen("gnuplot", shell=True, stdin=PIPE)
14     subproc.stdin.write("set terminal pdf\nset output '%s'\n" % argv[2])
15     shutil.copyfileobj(fsrc, subproc.stdin)
16     subproc.stdin.write("exit\n")
17     subproc.wait()