What does this line of code mean?
python.list at tim.thechases.com
Sun Nov 16 22:53:53 CET 2014
On 2014-11-16 22:45, Abdul Abdul wrote:
> I just came across the following line of code:
> outputfile = os.path.splitext(infile) + ".jpg"
> Can you kindly explain to me what those parts mean?
Have you tried them?
This takes a path and splits it into everything-but-the-extension,
and the extension. The "" takes the first part (without the
extension), and the "+ '.jpg'" part tacks on that extension.
So it changes whatever the existing extension is to .jpg
More information about the Python-list