>>5
I'm guess he doesn't want to have shit get reloaded everytime the program is ran. To put this in terms your monkey ass can understand, he wants to have the shit cached.
>>5
He wants to be able to load the function into a Python shell or otherwise load the script as a Python module. main() isn't a very descriptive name for what the function does though.
>>8 He wants to be able to load the function into a Python shell
And it will get loaded once. Geeze, why don't you just shut up and actually read the python docs instead of giving your own half assed description of what you think goes on.
Name:
Anonymous2012-01-04 14:30
>>9
You can't be very familiar with Python, or your English is bad, I can't tell.
If he had called the function without enclosing it in the if test then the function would be called every time he imported the module, it's typically used in small scripts such as >>1 to avoid just that.
If he had called the function without enclosing it in the if test then the function would be called every time he imported the module
Holy shit you're stupid. Have you ever written a non trivial Python script for any firm? I have. And in fact, the scripts I wrote run over several servers you moron. Anyways, what the OP did is correct. And what I described in correct. Now run along and go scrub another toilet.
Name:
Anonymous2012-01-04 14:37
>>11
What you described is correct, but what i described is also correct, if you seriously believe that OP was aiming for caching when writing that then you're incredibly dense, he did it so he could load the script as a module.
>>13
It is a possible explanation, and I'm not going to argue, it's very useful information to have as well, however, it is extremely unlikely to be what OP was aiming for with this tiny script.
Name:
Anonymous2012-01-04 14:46
Is Kodak-san seriously not telling that guy that he's a mental midget who should scrub another toilet?
Are you going soft on us Kodak-san?
Name:
Anonymous2012-01-04 15:16
just ignore kodak, he doesn't know what he's talking about. and he's rude.
>>8 is correct: the if construct is a common python idiom (OP probably got it from a tutorial).
Oh look Kodak shitting in another thread trying to look like a know-it-all while at the same time claiming it's worked with the big boys while the rest of you are just moron.
You know i'd rather have frozenvoid shitting it up with his EXPERT C than kodak being a nigger
Name:
Anonymous2012-01-04 17:49
>>24
I'm right though. Now shut up and try to learning something you uneducated jew.