Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Keep-trying-until-it-works

Name: Anonymous 2011-04-23 0:42

Due to lack of gotos, this is the shortest way I can come up with to tell python to keep doing something until it actually works (in my case, loading a webpage) is this:

tempvar = 1
while tempvar == 1:
    try:
        <stuff that will either work or cause an exception>
        tempvar = 0
    except:
        pass


in c++ i could just

lbl: try{stuff} catch {goto lbl;}

better way?

Name: Anonymous 2011-04-23 1:42

>>6
First of all, bitch, it's STACK UNWINDING, not fucking stack unrolling.  You stupid fuck.  Second, I WILL FUCKING USE EXCEPTIONS ALL I WANT.  I WILL USE THEM 20 TIMES PER FUNCTION AND NEST TRY BLOCKS OVER 9000 TIMES.  YOU CAN FUQIN SUCK MY DICK, CUNTFAG, GODFUCKINGDAMN.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List