From 346000d181625f199c706aab196f7fb94b4cbcdc Mon Sep 17 00:00:00 2001 From: Anita Patel Date: Mon, 13 Jan 2020 12:55:58 -0500 Subject: [PATCH] python script to convert images from png to jpg --- shell.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 shell.py diff --git a/shell.py b/shell.py new file mode 100644 index 0000000..601f380 --- /dev/null +++ b/shell.py @@ -0,0 +1,9 @@ +import glob, os + +# change into the image directory +os.chdir("image_batch") + +# process each png file +for file in glob.glob("*.png"): + os.system('magick convert %s %s.jpg'%(file,os.path.splitext(file)[0])) + print(f'Successfully converted {file} to jpg')