3 ms·
Yes, this. I was happily coding and kept failing the (very) simple "Shazoo" challenge because either 2.3 or your interpreter doesn't understand the "if __name_
by bmelton 16y ago
Yes, this. I was happily coding and kept failing the (very) simple "Shazoo" challenge because either 2.3 or your interpreter doesn't understand the "if __name__ == '__main__'" logic for Python portability. I'm ashamed to say that it took three tries before I just took that out and submitted a program that, while inferior, passed.
- federicof 16y agoI'm sorry for that, we're going to add support for 2.7 very soon!
- bmelton 16y agoUpon further reflection, it may be that you're loading the code dynamically or something (and not just running it as a command line application) or something that caused the __main__ not to trigger. Once I understood the constraint, I was fine. It's a neat little app, and for somebody who's never had an actual job as a programmer, some of these exercises I feel are things that I should at least know the pattern. I'm digging it.
- federicof 16y agoThanks! The code is executed by an "host" script with a system call, not sure if this breaks the __main__ function in python. We will look into that issue. :)