On 2014-11-16 22:45, Abdul Abdul wrote: > I just came across the following line of code: > > outputfile = os.path.splitext(infile)[0] + ".jpg" > > Can you kindly explain to me what those parts mean?
Have you tried them? https://docs.python.org/2/library/os.path.html#os.path.splitext This takes a path and splits it into everything-but-the-extension, and the extension. The "[0]" 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 -tkc -- https://mail.python.org/mailman/listinfo/python-list