A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-November/105364.html below:

[Python-Dev] KeyboardInterrupt not catch

[Python-Dev] KeyboardInterrupt not catch [Python-Dev] KeyboardInterrupt not catchQi Yong qiyong at sosdg.org
Mon Nov 8 02:43:33 CET 2010
Hello,

With this script, after ctrl-d, ctrl-c exception not catch.
Is it a python bug or a wrong exception usage? Thanks.
If with import readline, this problem disappears.

-- qiyong


def parse():
        try:
                answer = raw_input("Eo: ")
                print answer
        except EOFError:
                print("EOF")
        except KeyboardInterrupt:
                print("")

def main():
        while True:
                parse()

if __name__ == "__main__":
        main()


-- 
Qi Yong
More information about the Python-Dev mailing list

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