Fredrik Lundh wrote:
> Dustan wrote:
>
> > Ok, that worked (was it plain w or the writelines/readlines that messed
> > it up?).
>
> the plain "w"; very few image files are text files.
>
> > But Tkinter still can't find the image. I'm getting an error
> > message:
> >
> > TclError: image "C:\Docume
Dustan wrote:
> Ok, that worked (was it plain w or the writelines/readlines that messed
> it up?).
the plain "w"; very few image files are text files.
> But Tkinter still can't find the image. I'm getting an error
> message:
>
> TclError: image "C:\Documents and [pathname snipped]" doesn't exi
Justin Ezequiel wrote:
> cannot help you with Tkinter but...
>
> save=open("image.jpg","wb")
> save.write(web_download.read())
> save.close()
>
> perhaps this would let you open the file in Paint
Ok, that worked (was it plain w or the writelines/readlines that messed
it up?
Le Mardi 06 Juin 2006 03:08, Dustan a écrit :
>
> I should probably also mention, the only reason I downloaded the image
> to a file was because I don't know of any other way to do it. I feel no
> need to save the image to my hard drive.
using PIL, there is something like this (untested) :
(assum
cannot help you with Tkinter but...
save=open("image.jpg","wb")
save.write(web_download.read())
save.close()
perhaps this would let you open the file in Paint
--
http://mail.python.org/mailman/listinfo/python-list
I wrote:
> Nobody answered last time. I guess they wanted me to give it a shot.
> Well, here is how I download the image (it's a class method):
>
> def download_image(self):
> web_download=self.opener.open(self.url)
> save=open("image.jpg","w")
> save.writelines(web_down
Nobody answered last time. I guess they wanted me to give it a shot.
Well, here is how I download the image (it's a class method):
def download_image(self):
web_download=self.opener.open(self.url)
save=open("image.jpg","w")
save.writelines(web_download.readlines())