![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Binggowub
这个作者很懒,什么都没留下…
展开
-
PIL
ImageOpe模块 From PIL import Image, ImageOps # image_dir = r'D:\data\test.jpg' img = Image.open(image_dir) Autocontrast ImageOps.autocontrast(image, cutoff=0) img_ac = ImageOps.autocontrast(img, c原创 2017-07-26 14:07:16 · 214 阅读 · 0 评论 -
判断文件是否存在
判断文件是否存在os.path.exists(path) # ->True/False # 如果文件夹和文件同名,无法知晓检查的是文件还是文件夹(一般不会出现这种情况,检查文件肯定要带文件扩展名的) os.path.isfile(path) # ->True/False # 只能用于检查文件的path is_exist = pathlib.Path(path) # ->True/F原创 2017-07-27 09:08:00 · 307 阅读 · 0 评论 -
other_python
vim test.py # 建立test.py # test.py def say_morning(): print('Good morning %s' % __name__) if __name__ == '__main__': say_morning() chmod u+x test.py # 修改test.py为可执行文件当使用python test.py执行的时候原创 2017-07-27 09:35:25 · 545 阅读 · 0 评论 -
模块的导入与执行
vim test.py # 建立test.py # 在vim剪辑器中编辑以下四行内容 def say_morning(): print('Good morning %s' % __name__) if __name__ == '__main__': say_morning()chmod u+x test.py # 修改test.py为可执行文件当使用python test原创 2017-07-29 10:55:10 · 247 阅读 · 0 评论