Re: [問題] 如何將圖片載入

看板Python作者時間16年前 (2007/09/27 11:00), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/6 (看更多)
※ 引述《musicmen ()》之銘言: : 求敎一下.小弟新手 : 我用的是PIL Image的模組 : import Image : im = Image.open("pic.png") : 它顯示結果如下..(感覺應該是沒有設定路徑的關係)所以抓不到圖片 : Traceback (most recent call last): : File "<interactive input>", line 1, in ? : File "C:\Python24\Lib\site-packages\PIL\Image.py",line 1888, in open : fp = __builtin__.open(fp, "rb")IO : Error: [Errno 2] No such file or directory: 'Ping.png' : 請問該如何設定? 感謝大大的指導 已經可將圖片載入 不過目前又碰到另一個問題 我想一次loading約2000張圖片 不過Image.open指令似乎在500張的時候就會停住,顯示 IOError: [Errno 24] Too many open files: 'C:/Python24/tepic/ping507.png' 我的迴圈是 list = [] nu =2000 for i in range(nu) im =Image.open('C:/Python24/ping'+'str(i)'+'.png') list.append(im) 請問是500張是他loading的極限嗎?我的圖片每張都大約2kb 如果一次要present 10000張圖片的是否有更好的寫法? -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.129.77.12
文章代碼(AID): #16-npfrZ (Python)
討論串 (同標題文章)
文章代碼(AID): #16-npfrZ (Python)