Activating `-i' from inside a script?

François Pinard pinard at
Fri Jun 27 13:49:59 CEST 2003

[Troy Melhase]

> if __name__ == '__main__':
>     discrepancy = True
>     if discrepancy:
>         os.environ['PYTHONINSPECT'] = "why yes, i'd like that"

> A quick read of Modules/main.c shows that the environment variable is
> checked at program start, not at end.  Maybe this is a bug?

It would be nice if the Python crew was willing to see this as a bug.  A
program might also delete PYTHONINSPECT if it feels shy to get naked. :-)

François Pinard

More information about the Python-list mailing list