[問題] 如何將圖片載入

看板Python作者時間16年前 (2007/09/20 18:39), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/6 (看更多)
求敎一下.小弟新手 我用的是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' 請問該如何設定? -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.129.77.12

09/20 22:09, , 1F
Image.open('c:\\ooxx\\ooxx.png') ?
09/20 22:09, 1F

09/28 23:03, , 2F
也可以 Image.open(r'c:\foo\bar.png')
09/28 23:03, 2F
文章代碼(AID): #16yatqQ3 (Python)
討論串 (同標題文章)
文章代碼(AID): #16yatqQ3 (Python)