赞
踩
['D:\照片\\' + i for i in os.listdir('D:\照片')]
:os.listdir(‘这里写上你图片的保存路径’)
Screen().bgpic(pic_list[num])
,加载图片至turtle的窗口上
Screen().update()
,刷新窗口ontimer(run, 1000),这里是间隔的时间,单位毫秒
import os from turtle import * pic_list = ['D:\照片\\' + i for i in os.listdir('D:\照片')] num = 0 def run(): global num if num > 4: num = 0 Screen().bgpic(pic_list[num]) Screen().update() num += 1 ontimer(run, 1000) run() done()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。