gtb wrote: > appear at the end of many examples I see. Is this to cause a .class > file to be generated? This might be obvious, but no one else mentioned it: the Python interpreter cannot execute code that it hasn't compiled yet, which is why the "if __name__ ..." code is always at the end of the module - to guarantee that the entire file is scanned first. -- http://mail.python.org/mailman/listinfo/python-list
- Re: if __name__ == 'main': & passing an arg to a class... Bart Willems
- Re: if __name__ == 'main': & passing an arg to a ... John Machin
- Re: if __name__ == 'main': & passing an arg to a ... Duncan Booth
- Re: if __name__ == 'main': & passing an arg to a ... Steven D'Aprano