python图片旋转
- 少废话,直接上代码
#!/usr/bin/env python
import os
from optparse import OptionParser
from sys import stdout
# 导入损坏图片
from PIL import ImageFile, Image
ImageFile.LOAD_TRUNCATED_IMAGES = True
# 计数器
def out_hint(total=[0]):
total[0] += 1
stdout.write('generating %6dimgs...\r' % total[0])
stdout.flush()
# 新建文件夹
def make_folder(folder_name):
if not os.path.exists(folder_name):
os.mkdir(folder_name)
# 命令行获取参数