Pathname problem

Bjarke Dahl Ebert bjarke-news2003 at trebe.dk
Tue Apr 8 15:35:27 EDT 2003


"bourassa" <bourassa-m at rmc.ca> wrote in message
news:3e9321b5$1 at rmcnt03a.rmc.ca...
> Hi there.  I am just trying to load files using PIL.  I get the following:
>
> im=Image.open("C:\MATLAB6p1\toolbox\pout.tif")
[...]
> IOError: [Errno 2] No such file or directory:
> 'C:\\MATLAB6p1\toolbox\\pout.tif'

Hint: \t is the TAB character ;-)

Either, "C:\\MATLAB6p1\\toolbox\\pout.tif"
or r"C:\MATLAB6p1\toolbox\pout.tif"
will help. The r"..." syntax means that backslashes are interpreted
litterally.


Bjarke








More information about the Python-list mailing list