Hey guys,
Well I'm onto images now but the tutorial I'm using seems to be good but I can't understand the input process. And I know you guys are great at this stuff so thought you might lend a hand here to get me up and started. The code the guy in the tutorial is using goes like this.
import os, sys
import Image
for infile in sys.argv[1:]:
f, e = os.path.splitext(infile)
outfile = f + ".jpg"
if infile != outfile:
try:
Image.open(infile).save(outfile)
except IOError:
print "cannot convert", infile
So anyway just started messing around with it and I'm not getting any information into sys.argv[1:] using similar code, I commented out the ones I still wanna learn but won't use for now. It looks like this.
import os, sys
import Image
im = Image.open("D:\\pics\\jennifer.bmp")
#print im.format, im.size, im.mode
#im.show()
for im in sys.argv[1:]:
f, e = os.path.splitext(im)
outfile = f + ".jpg"
if im != outfile:
try:
Image.open(im).save(outfile)
except IOError:
print "cannot convert", im
I guess its supposed to convert from one file type to another, but don't seem to be getting any information to the sys.argv[1:] module. So I guess my question is how does that work, and how can I get this up and running to test it?