3 from subprocess import Popen, PIPE
4 from sys import argv, stderr, exit
8 stderr.write("Usage: %s <src_file> <dst_file>\n" % argv[0])
11 with open(argv[1], 'rb') as fsrc:
12 subproc = Popen("gnuplot", shell=True, stdin=PIPE)
13 subproc.stdin.write(b"set terminal pdf\nset output '%s'\n" % argv[2].encode())
14 shutil.copyfileobj(fsrc, subproc.stdin)
15 subproc.stdin.write(b"exit\n")