Ehsan wrote:
> On Aug 3, 10:10 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
[...]
>> I'm guessing there are binary files and you are running on Windows,
>> which is inserting a carriage return before ebery newline. Try
>>
>> localFile = open(fileName, 'wb')
>>
>> to avoid thus behavior.
[...
Il Fri, 03 Aug 2007 14:32:19 -0700, Ehsan ha scritto:
> It works but could you explain more what's wrong with just 'w'?
On Unix-like systems newline means '\n'
On Window newline means '\r\n'
So, when you open a file on Window with 'w' option, Win replace
downloaded '\n' with a local '\r\n' an
On Aug 3, 10:10 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> Ehsan wrote:
> > I foundd this code in ASPN Python Cookbook for downloading files in
> > python but when it finished downloading files the files became
> > corrupted and didn't open, the files in intern
On Aug 3, 1:48 pm, Ehsan <[EMAIL PROTECTED]> wrote:
> I foundd this code in ASPN Python Cookbook for downloading files in
> python but when it finished downloading files the files became
> corrupted and didn't open, the files in internet havn't any problem:
>
On Fri, 2007-08-03 at 11:48 -0700, Ehsan wrote:
> I foundd this code in ASPN Python Cookbook for downloading files in
> python but when it finished downloading files the files became
> corrupted and didn't open, the files in internet havn't any problem:
>
>
&g
Ehsan wrote:
> I foundd this code in ASPN Python Cookbook for downloading files in
> python but when it finished downloading files the files became
> corrupted and didn't open, the files in internet havn't any problem:
>
>
> def download(url,fileName):
>
I foundd this code in ASPN Python Cookbook for downloading files in
python but when it finished downloading files the files became
corrupted and didn't open, the files in internet havn't any problem:
def download(url,fileName):
"""Copy the contents of a file fr
ah - thanks for your help, but what is happening is the first line
being returned contains the field names from the csv file! Schoolboy
errors :-)
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Thanks - but have printed and verified they are valid paths and
> filenames. One correction to the code I listed:
>theurl = imagepath[:-8]
>
> For some reason the values aren't being passed through
> urllib.urlretrieve properly but this makes no sense to me?
>
A wo
Martin Franklin wrote:
> [EMAIL PROTECTED] wrote:
>> Hi,
>> I'm using Python 2.3 on Windows for the first time, and am doing
>> something wrong in using urllib to retrieve images from urls embedded
>> in a csv file. If I explicitly specify a url and image name it works
>> fine(commented example in
Martin Franklin wrote:
> "No such file or directory: ''" sounds to me like you are trying
> to open a file called '' (empty string)
>
> try adding some debugging
>
> print theimage, imagepath
or, better:
print repr(theimage), repr(imagepath)
--
http://mail.python.org/mailman/listi
Thanks - but have printed and verified they are valid paths and
filenames. One correction to the code I listed:
theurl = imagepath[:-8]
For some reason the values aren't being passed through
urllib.urlretrieve properly but this makes no sense to me?
--
http://mail.python.org/mailman/listinfo/
Hi,
I'm using Python 2.3 on Windows for the first time, and am doing
something wrong in using urllib to retrieve images from urls embedded
in a csv file. If I explicitly specify a url and image name it works
fine(commented example in the code), but if I pass in variables in this
for loop it throws
[EMAIL PROTECTED] wrote:
> Hi,
> I'm using Python 2.3 on Windows for the first time, and am doing
> something wrong in using urllib to retrieve images from urls embedded
> in a csv file. If I explicitly specify a url and image name it works
> fine(commented example in the code), but if I pass in
> If so please guid me a bit here.
I aaume you mean 'guido' here ?
;-)
Anyway - you probably want to be using urllib2 as the other poster
points out.
Regards,
Fuzzy
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
On Monday 27 June 2005 12:10, Oyvind Ostlund wrote:
> I have to download a lot of files. And at the moment i am trying with
> URLLib. But sometimes it doesn't download the whole file. It looks like it
> stops half way through or something. Is it possible to ask for the file
> size before you
Hello,
I have to download a lot of files. And at the moment i am trying with URLLib.
But sometimes it doesn't download the whole file. It looks like it stops
half way through or something. Is it possible to ask for the file size before
you download, and then test afterwards if the whole file wa
17 matches
Mail list logo