Skip Montanaro <skip@pobox.com> writes: > On c.l.py someone asked about forcing a tailend interactive shell from > within the program. Try Melhase proposed: > > import os > > if __name__ == '__main__': > discrepancy = True > if discrepancy: > os.environ['PYTHONINSPECT'] = "why yes, i'd like that" > > but observed that it doesn't work because the environment variable is only > checked at program start. > > This change to Modules/main.c makes the above work: [...] > > Any chance this could be squeezed in? It seems rather elegant: > > try: > something which fails > except: > os.environ["PYTHONINSPECT"] = 1 > raise > > (I know we're at beta1, and the programmer could re-run with -i. But > still...) > For a different approach to the same (?) problem see http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65287 Thomas
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4