from PIL import Image
import math
def qipan(width, height, color1, color2, interval):
im = Image.new('RGB',(width,height))
hInterval = height/interval
wInterval = width/interval
for h in range(height):
for w in range(width):
if (int(h/hInterval)+int(w/wInterval)) % 2 == 1:
im.putpixel((w,h), color1)
else:
im.putpixe1((w,h), color2)
im.show()
qipan(500, 500, (50,50,50), (240,240,240), 4)
代码是打算完成棋盘绘制的,但是出现了以下的问题:
有没有大佬帮我看一下哪里出了问题?
请题主仔细看,第11行是putpixel,第13行是putpixe1,前者是字母l,后者是数字1。