学习
weixin_51762856
这个作者很懒,什么都没留下…
展开
-
python中[::]的含义
python中[::]的含义[:-1]b = [1,2,3,4,5,6]print(b[:-1])out:[1, 2, 3, 4, 5]简而言之就是裁减掉最后一位[::-1]print(b[::-1])out: [6, 5, 4, 3, 2, 1]倒序输出原创 2021-01-07 19:37:41 · 40128 阅读 · 0 评论 -
python图像分类出现错误PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x000001
import os from PIL import Image folder_path = 'F:\\PetImages\\test_image' extensions = [] for fldr in os.listdir(folder_path): sub_folder_path = os.path.join(folder_path, fldr) for filee in os.listdir(sub_folder_path): file_path = os.path.join(sub_folder_p原创 2020-12-24 10:07:30 · 5922 阅读 · 2 评论