[Tutor] subprocess.call

davidwilson at Safe-mail.net davidwilson at Safe-mail.net
Mon Jul 27 20:40:27 CEST 2009


OK I think I found my error, here is what I did:

flags = set([file for file in glob.glob('flag-*.svg')])

def call(cmd):
    subprocess.call([cmd], shell=True)

for flag in flags:
    name = flag[:-4]
    out = name+'.png'
    call('svg2png --width=17 --height=12 %s %s' \
               % (flag, out))

Is this better?


More information about the Tutor mailing list