Lounge of Tomorrow

Lounge of Tomorrow (http://74.208.121.111/LoT/index.php)
-   Egg Head (http://74.208.121.111/LoT/forumdisplay.php?f=13)
-   -   A question for any code jockeys (http://74.208.121.111/LoT/showthread.php?t=10523)

Pirate Bill 05-28-2010 10:18 AM

Quote:

Originally Posted by Ghoulish Delight (Post 324407)
When I run this and it gets to that 2nd loop instead of executing as:
ClassList[0].Method1()
subprocess.call
other work
ClassList[1].Method1()
subprocess.call
other work
ClassList[2].Method1(0
....

I get:
ClassList[0].Method1()
ClassList[1].Method1()
ClassList[2].Method1()
ClassList[3].Method1()
ClassList[4].Method1()
subprocess.call
other work
subprocess.call
other work
subprocess.call
other work
subprocess.call
other work
subprocess.call
other work

My understanding of Python is rather basic, but I think I see the problem. You need to indent the For j loop so it's nested in the For i loop.

ETA: I just reread and this probably won't work either. Meh, it was a shot.

Ghoulish Delight 05-28-2010 10:50 AM

Huh? You lost me PB. I don't see how any of what you posted can be read as vague programming-related sexual innuendo.





No, the loops shouldn't be nested. The first is initializing the list of MyClass objects, the 2nd is referencing the objects in the list.

C has the "volatile" key word which more or less guarantees in-order execution, compiler optimization be damned. I was just wondering if anyone knew an equivalent in Python.

Pirate Bill 05-28-2010 01:45 PM

Quote:

Originally Posted by Ghoulish Delight (Post 324507)
Huh? You lost me PB. I don't see how any of what you posted can be read as vague programming-related sexual innuendo.

Oops, my bad. Back on topic... Compiler? I hardly new her!

scaeagles 05-28-2010 02:32 PM

Quote:

Originally Posted by Ghoulish Delight (Post 324507)
C has the "volatile" key word

Hey baby....what's your volatile key word?

Ghoulish Delight 01-12-2011 12:00 AM

God damnit I love XKCD. LOVE XKCD!!!!



All times are GMT -7. The time now is 02:48 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.