Horje
Convert files to JPEG Code Example
Convert files to JPEG
import os, sys
from PIL import Image

for infile in sys.argv[1:]:
    f, e = os.path.splitext(infile)
    outfile = f + ".jpg"
    if infile != outfile:
        try:
            with Image.open(infile) as im:
                im.save(outfile)
        except OSError:
            print("cannot convert", infile)
Convert files to JPEG
import os, sys
from PIL import Image

for infile in sys.argv[1:]:
    f, e = os.path.splitext(infile)
    outfile = f + ".jpg"
    if infile != outfile:
        try:
            with Image.open(infile) as im:
                im.save(outfile)
        except OSError:
            print("cannot convert", infile)




Python

Related
python get an online file Code Example python get an online file Code Example
matrix python math Code Example matrix python math Code Example
* pattern program in python Code Example * pattern program in python Code Example
ffmpeg python Code Example ffmpeg python Code Example
remove last character from string python Code Example remove last character from string python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8