import subprocess
from os import listdir
for f in listdir('.'):
    if f.endswith('.pdf'):
        command = 'convert -resize 300x480 "{}" "{}"'.format(f + '[0]', f[:
            -4] + '.jpg')
        subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)

e32bb050d812acff0ae6cad4254a34de5a727e65
<mask token>

<mask token>
for f in listdir('.'):
    if f.endswith('.pdf'):
        command = 'convert -resize 300x480 "{}" "{}"'.format(f + '[0]', f[:
            -4] + '.jpg')
        subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)

import subprocess
from os import listdir
for f in listdir('.'):
    if f.endswith('.pdf'):
        command = 'convert -resize 300x480 "{}" "{}"'.format(f + '[0]', f[:
            -4] + '.jpg')
        subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
