python PIL image.open()错误
你好我正在使用PIL来打开图像,但也有这样的错误; 回溯(最近通话最后一个):python PIL image.open()错误
File "/Users/minsw0810gmail.com/Desktop/GUIAccidentAlarm.py", line
142, in <module>
filename1 = Image.open('횡단보도상_100x100.jpg', "rb")
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/PIL/Image.py", line 2462, in open
raise ValueError("bad mode %r" % mode)
ValueError: bad mode 'rb'
[Finished in 0.8s with exit code 1]
[shell_cmd: python -u
"/Users/minsw0810gmail.com/Desktop/GUIAccidentAlarm.py"]
[dir: /Users/minsw0810gmail.com/Desktop]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
*횡단보도상_100x100.jpg是韩国 和我的代码是
文件名1 = Image.open( '횡단보도상_100x100.jpg' )
Image.open()仅支持“r”作为模式参数并引发其他所有情况的异常。
这里是什么医生说这个参数:
模式 - 模式。如果给出,这个论据必须是“r”。
因为在这里有更多信息的链接:
http://pillow.readthedocs.io/en/3.4.x/reference/Image.html#PIL.Image.open
我希望这可以帮助你。
所以你可以修复我的代码吗? –
你的意思是我应该写 filename1 = Image.open(“횡단보도상_100x100.jpg”,“r”)??? –
只是不写任何东西,除了文件路径 – fl4w
错误是不言自明的... –