Newbie coding question - format error

2014-06-29 Thread Martin S
Hi again, Still working leisurely through the tutorial here: http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/io.html An excise at the end of second 1.10 says to Write a version of the quotient problem in *Exercise for Quotients*

Re: print statements and profiling a function slowed performance

2014-06-29 Thread Chris Angelico
On Sun, Jun 29, 2014 at 4:14 PM, Dennis Lee Bieber wrote: > On Sat, 28 Jun 2014 23:50:26 +1000, Chris Angelico > declaimed the following: > >>No, they were measured; but the exact difference will depend on Python >>version, console, OS, etc, etc, etc, etc, etc, which is why I said >>"maybe 100ms"

Re: why i can't install ez_setup

2014-06-29 Thread Peter Tomcsanyi
"Mark Lawrence" wrote in message news:lonp2t$gk3$1...@ger.gmane.org... I don't consider that particularly sound adice. easy_install is hardly an "obscure Python installation tool". If you get pip it will look after the dependancies for you. The site you're referenced is unofficial. FWIW

Writing Multiple files at a times

2014-06-29 Thread subhabangalore
Dear Group, I am trying to crawl multiple URLs. As they are coming I want to write them as string, as they are coming, preferably in a queue. If any one of the esteemed members of the group may kindly help. Regards, Subhabrata Banerjee. -- https://mail.python.org/mailman/listinfo/python-list

Re: Writing Multiple files at a times

2014-06-29 Thread Mark Lawrence
On 29/06/2014 11:49, subhabangal...@gmail.com wrote: Dear Group, I am trying to crawl multiple URLs. As they are coming I want to write them as string, as they are coming, preferably in a queue. If any one of the esteemed members of the group may kindly help. Regards, Subhabrata Banerjee.

Re:Writing Multiple files at a times

2014-06-29 Thread Dave Angel
subhabangal...@gmail.com Wrote in message: > Dear Group, > > I am trying to crawl multiple URLs. As they are coming I want to write them > as string, as they are coming, preferably in a queue. > > If any one of the esteemed members of the group may kindly help. > >From your subject line, it

Re: Writing Multiple files at a times

2014-06-29 Thread Roy Smith
In article , Dave Angel wrote: > subhabangal...@gmail.com Wrote in message: > > Dear Group, > > > > I am trying to crawl multiple URLs. As they are coming I want to write them > > as string, as they are coming, preferably in a queue. > > > > If any one of the esteemed members of the group ma

Re: Newbie coding question - format error

2014-06-29 Thread Sibylle Koczian
Am 29.06.2014 09:06, schrieb Martin S: x=int(input('Enter an integer ')) y=int(input('Enter another integer ')) z=int(input('Enter a third integer ')) formatStr='Integer {0}, {1}, {2}, and the sum is {3}.' equations=formatStr.format(x,y,z,x+y+z) print(equations) formatStr2='{0} divided by {1} is

Re: Newbie coding question - format error

2014-06-29 Thread Roy Smith
In article , Sibylle Koczian wrote: > Am 29.06.2014 09:06, schrieb Martin S: > > IndexError: tuple index out of range > > > > {0} ... {3} are just placeholders in your format strings, they can't > exist outside of them. And you can't put more placeholders into the > format string than you've

Re: Newbie coding question - format error

2014-06-29 Thread Terry Reedy
On 6/29/2014 3:06 AM, Martin S wrote: A couple of additional notes: x=int(input('Enter an integer ')) y=int(input('Enter another integer ')) z=int(input('Enter a third integer ')) formatStr='Integer {0}, {1}, {2}, and the sum is {3}.' When the replacement fields and arguments are in the same

Re: Writing Multiple files at a times

2014-06-29 Thread subhabangalore
On Sunday, June 29, 2014 7:31:37 PM UTC+5:30, Roy Smith wrote: > In article , > > Dave Angel wrote: > > > > > subhabangal...@gmail.com Wrote in message: > > > > Dear Group, > > > > > > > > I am trying to crawl multiple URLs. As they are coming I want to write > > > them > > > > as stri

Re: Newbie coding question - format error

2014-06-29 Thread Martin S
Thanks for the input. The main thing was that On 29 Jun 2014, Terry Reedy wrote: >On 6/29/2014 3:06 AM, Martin S wrote: > >A couple of additional notes: > >> x=int(input('Enter an integer ')) >> y=int(input('Enter another integer ')) >> z=int(input('Enter a third integer ')) >> formatStr='Intege

Re: Newbie coding question - format error

2014-06-29 Thread Martin S
Thanks for the input. The main thing was that the replacement fields were only valid for their local environment. /martin On 29 Jun 2014, Terry Reedy wrote: >On 6/29/2014 3:06 AM, Martin S wrote: > >A couple of additional notes: > >> x=int(input('Enter an integer ')) >> y=int(input('Enter ano

Re: Writing Multiple files at a times

2014-06-29 Thread Denis McMahon
On Sun, 29 Jun 2014 10:32:00 -0700, subhabangalore wrote: > I am opening multiple URLs with urllib.open, now one Url has huge html > source files, like that each one has. As these files are read I am > trying to concatenate them and put in one txt file as string. > From this big txt file I am tryi