Sybren Stuvel wrote:
> Antoine De Groote enlightened us with:
>
>>I hope I don't upset anybody by comparing Python to Ruby (again). Is
>>there something like Ruby's retry keyword in Python?
>
>
> Please don't assume that everybody knows Ruby through and through...
>
I didn't see any such assum
Everyone wrote:
> [cool stuff]
Ps. I've only used retry a handful of times in about 3 or 4 years of
using ruby; I wasn't advocating it or criticizing python, just trying
to explain the OPs request.
Regards,
Jordan
--
http://mail.python.org/mailman/listinfo/python-list
> In ruby, the equivalent to try...except is begin...rescue. In the
> rescue section you can ask it to retry the begin section. So, for
> example:
>
> b=0
> begin
> puts 1/b
> rescue
> b=1
> retry # <- this little guy
> end
Well, it's all a matter of how you look at it. I personally
pref
MonkeeSage wrote:
> I don't think python has any equivalent (could be wrong).
a trivial combination of while and try/except/else does the trick:
n = 0
while 1:
try:
# do something
print n
n = n + 1
# make sure it fails a couple of times
if n < 10:
MonkeeSage schrieb:
> Sybren Stuvel wrote:
>> Antoine De Groote enlightened us with:
>>> I hope I don't upset anybody by comparing Python to Ruby (again). Is
>>> there something like Ruby's retry keyword in Python?
>> Please don't assume that everybody knows Ruby through and through...
>
> In ruby
Sybren Stuvel wrote:
> Antoine De Groote enlightened us with:
> > I hope I don't upset anybody by comparing Python to Ruby (again). Is
> > there something like Ruby's retry keyword in Python?
>
> Please don't assume that everybody knows Ruby through and through...
In ruby, the equivalent to try...
Antoine De Groote enlightened us with:
> I hope I don't upset anybody by comparing Python to Ruby (again). Is
> there something like Ruby's retry keyword in Python?
Please don't assume that everybody knows Ruby through and through...
Sybren
--
Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/
-
Hi,
I hope I don't upset anybody by comparing Python to Ruby (again). Is
there something like Ruby's retry keyword in Python? I couldn't find any
thing...
Regards,
antoine
--
http://mail.python.org/mailman/listinfo/python-list