我正在尝试使用Python来使用Pillow库批量编辑.png文件.这是我使用python的第一个脚本,因此可能存在许多错误和/或错误的编程习惯.
这是我目前的代码:
from PIL import Image
from PIL import ImageDraw
from os.path import basename
import os, sys
path = "D:\Pokemon Game\Pokemon Eggs\Import"
dirs = os.listdir( path )
box = (2,1,30,31)
moveup = (0, -3, -7, -11, -15, -19, -15, -9, -5, 2, 12, 14, 16, 17, 12, 8, 4, 0, -7, -13, -19, -11, -7, -5, -3)
topspace = (36, 38, 42, 46, 50, 55, 50, 44, 40, 34, 24, 22, 20, 18, 24, 28, 32, 36, 42, 48, 55, …Run Code Online (Sandbox Code Playgroud)