Image.open( "C:\test.jpg") is this wrong ?

Carnell, James E jecarnell at saintfrancis.com
Mon Aug 27 10:48:46 EDT 2007



> I am trying to simply open an image with PIL... My problem is that I
> don't know what my active directory is so I am putting an absolute
> path name in quotes. It can't find the specified file or directory.
> I'm horrible with docs. I also tried to save an image file (to find
> where it saved it, but I didn't understand what mode is (I now know it
> is RGB etc.). Does everyone usually do fairly well with the docs
> except for me??? For instance, it says Image.open(file, ...something
> else [I'm at work so I don't remember]). How am I supposed to know
> even to put quotes around the filepath? I'm really starting to wonder
> if there is something wrong with me.
> 
> So How do I open an image?
> 
> Image.open("C:\test.jpg")  # this is what I have right now. And it
> can't find the file or directory. The file is there (it is everywhere
> on my computer now!!!)
> 
I found some code where they apply the file path to a variable in single
quotes. Is that how it is done. Also I thought single quotes were for
characters not strings.

> Sincerely,
> 
> James Carnell
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070827/00451c7b/attachment.html>


More information about the Python-list mailing list