Error in opening image file in PIL

前端 未结 6 561
闹比i
闹比i 2021-01-02 21:25

I am trying to execute the following code

from pytesser import *
import Image

i=\"C:/Documents and Settings/Administrator/Desktop/attachments/R1PNDTCB.jpg\"         


        
6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-02 22:05

    Try this first:

    os.path.expanduser('~/Desktop/attachments/R1PNDTCB.jpg')

    It could be that the space in the 'Documents and Settings' is causing this problem.

    EDIT:

    Use os.path.join so it uses the correct directory separator.

提交回复
热议问题