Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)
Comment

PREVIOUS NEXT
Code Example
Python :: python global variables 
Python :: a list inside a list python 
Python :: float and int difference 
Python :: store message sent by user in string discord py 
Python :: sum of the number in a list in python 
Python :: python docstring use 
Python :: python button click code 
Python :: join tables pandas 
Python :: stingray 
Python :: delete function python 
Python :: min max python 
Python :: how to add items in list in python 
Python :: how to replace zero value in python dataframe 
Python :: add key to dictionairy 
Python :: socket.accept python 
Python :: group by data 
Python :: find key by value python 
Python :: Check if all values in list are greater than a certain number 
Python :: python elif syntax 
Python :: check if object is list python 
Python :: how to make a calcukatir 
Python :: find max value in 2d array python 
Python :: grab the first letter of each string in an array python 
Python :: python launch prompt 
Python :: install python cap 
Python :: python if else interview questions 
Python :: pandas qcut 
Python :: python schleife 
Python :: print backwards python 
Python :: how to open link in new tab selenium python 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =