Skip to content

Instantly share code, notes, and snippets.

@anbara
Created June 3, 2017 10:21
Show Gist options
  • Save anbara/11ec16a0152e0b3b1a8fc95007430d40 to your computer and use it in GitHub Desktop.
Save anbara/11ec16a0152e0b3b1a8fc95007430d40 to your computer and use it in GitHub Desktop.
import glob
from subprocess import Popen
import os
os.mkdir('eps')
file = glob.glob('ps/*')
print(file)
for num in range(len(file)):
print(num)
cmd = 'ps2eps ' + file[num]
popen = Popen(cmd, shell=True)
popen.wait()
badeps = glob.glob('ps/*.eps')
for num2 in range(len(badeps)):
print(num2)
ok = os.path.basename(badeps[num2])
cmd2 = 'gswin64c -o eps/' + ok + ' -dNoOutputFonts -sDEVICE=eps2write ps/' + ok
popen2 = Popen(cmd2, shell=True)
popen2.wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment