On 2006-01-28, Charles Krug <[EMAIL PROTECTED]> wrote: > On 2006-01-28, Peter Otten <[EMAIL PROTECTED]> wrote: >> Charles Krug wrote: >> >>> Is there a way to detect that I'm running the the PyWin interpreter so >>> that I can bypass its raw_input behavior? >> >> You could test >> >> if pywin_specific_module in sys.modules: >> # use workaraound >> >> Or maybe you can get away with always using sys.stdin.readline() instead of >> raw_input()? Look into cmd.py for an example. >> >> Peter >> > > cmd.py is the "battery included" I was thinking of last night. > Unfortunately it uses something that PyWin replaces. > > However I did note that PyWin's version raises KeyboardInterrupt out of > its dialog box. > > That's not ideal, but at least it gives me an idea what I need to trap > to exit. >
Okay, I poked around a bit more and found the initialization code that does this: sys.modules['__builtin__'].raw_input=Win32RawInput Which is the substituted function. Is there a way to access the original function that I want to use, or do I need to come up with some other way to do console input? Thanks -- http://mail.python.org/mailman/listinfo/python-list