Re: python dowload

2010-02-27 Thread Tim Chase
Aahz wrote: monkeys paw wrote: On 2/23/2010 3:17 PM, Tim Chase wrote: Sure you don't need this to be 'wb' instead of 'w'? 'wb' does the trick. Thanks all! import urllib2 a = open('adobe.pdf', 'wb') i = 0 for line in urllib2.urlopen('http://www.whirlpoolwaterheaters.com/downloads/6510413.pd

Re: python dowload

2010-02-27 Thread Aahz
In article <2fwdnxofjat-whnwnz2dnuvz_rgdn...@insightbb.com>, monkeys paw wrote: >On 2/23/2010 3:17 PM, Tim Chase wrote: >> >> Sure you don't need this to be 'wb' instead of 'w'? > >'wb' does the trick. Thanks all! > >import urllib2 >a = open('adobe.pdf', 'wb') >i = 0 >for line in >urllib2.urlop

Re: python dowload

2010-02-24 Thread Diez B. Roggisch
Am 24.02.10 00:08, schrieb monkeys paw: On 2/23/2010 3:17 PM, Tim Chase wrote: monkeys paw wrote: I used the following code to download a PDF file, but the file was invalid after running the code, is there problem with the write operation? import urllib2 url = 'http://www.whirlpoolwaterheaters

Re: python dowload

2010-02-23 Thread Ethan Furman
monkeys paw wrote: NEW QUESTION if y'all are still reading: Is there an integer increment operation in Python? I tried using i++ but had to revert to 'i = i + 1' Nope, but try i += 1. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: python dowload

2010-02-23 Thread Wes James
> > > NEW QUESTION if y'all are still reading: > > Is there an integer increment operation in Python? I tried > using i++ but had to revert to 'i = i + 1' i+=1 -- http://mail.python.org/mailman/listinfo/python-list

Re: python dowload

2010-02-23 Thread monkeys paw
On 2/23/2010 3:17 PM, Tim Chase wrote: monkeys paw wrote: I used the following code to download a PDF file, but the file was invalid after running the code, is there problem with the write operation? import urllib2 url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf' a = open('ado

Re: python dowload

2010-02-23 Thread Shashwat Anand
PyPdf/pdfminer library will be of help On Wed, Feb 24, 2010 at 1:47 AM, Tim Chase wrote: > monkeys paw wrote: > >> I used the following code to download a PDF file, but the >> file was invalid after running the code, is there problem >> with the write operation? >> >> import urllib2 >> url = 'htt

Re: python dowload

2010-02-23 Thread sstein...@gmail.com
On Feb 23, 2010, at 2:42 PM, monkeys paw wrote: > I used the following code to download a PDF file, but the > file was invalid after running the code, is there problem > with the write operation? > > import urllib2 > url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf' > a = open('

Re: python dowload

2010-02-23 Thread David Robinow
On Tue, Feb 23, 2010 at 2:42 PM, monkeys paw wrote: > I used the following code to download a PDF file, but the > file was invalid after running the code, is there problem > with the write operation? > > import urllib2 > url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf' > a = open

Re: python dowload

2010-02-23 Thread Jerry Hill
On Tue, Feb 23, 2010 at 2:42 PM, monkeys paw wrote: > I used the following code to download a PDF file, but the > file was invalid after running the code, is there problem > with the write operation? > > import urllib2 > url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf' > a = open

Re: python dowload

2010-02-23 Thread Tim Chase
monkeys paw wrote: I used the following code to download a PDF file, but the file was invalid after running the code, is there problem with the write operation? import urllib2 url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf' a = open('adobe.pdf', 'w') Sure you don't need this

Re: python dowload

2010-02-23 Thread John Bokma
monkeys paw writes: > I used the following code to download a PDF file, but the > file was invalid after running the code, is there problem > with the write operation? > > import urllib2 > url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf' > a = open('adobe.pdf', 'w') > for line i

python dowload

2010-02-23 Thread monkeys paw
I used the following code to download a PDF file, but the file was invalid after running the code, is there problem with the write operation? import urllib2 url = 'http://www.whirlpoolwaterheaters.com/downloads/6510413.pdf' a = open('adobe.pdf', 'w') for line in urllib2.urlopen(url): a.write(