簡體   English   中英

使用 PILLOW 導入和操作圖像

[英]Importing & manipulating images with PILLOW

我正在嘗試使用 python 圖像庫導入圖像。 當我運行這段代碼時,我不斷收到一個錯誤,提示文件或目錄不存在:

from PIL import Image 
img = Image.open("Users/tylercordeiro/hello/sunrisesunsettime.jpeg")

我做錯了什么嗎? 我需要用一種特定的方式來輸入我的文件/目錄的名稱嗎?

嘗試使用絕對路徑。 我在文件名的開頭添加了一個/slash

from PIL import Image 
im = Image.open("/Users/tylercordeiro/hello/sunrisesunsettime.jpeg")
im

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM