Namespace Qualification Question

Jeff Shannon jeff at ccvcorp.com
Fri Mar 22 15:55:00 EST 2002


Craig McLean wrote:

> Is there a module assosciated with the file you started the interpreter
> with, and if there is what is it's name?  For instance
>
>  > python qux.py
>
> I would have thought that there would be a qux module, and that it's
> name would be stored in the __name__ builtin.

It *is* stored in the __name__ builtin... but the script that python is
started with is always named __main__ (thus the "if __name__ ==
'__main__':" idiom).

Jeff Shannon
Technician/Programmer
Credit International





More information about the Python-list mailing list