pyswip icon indicating copy to clipboard operation
pyswip copied to clipboard

Ctrl-C not working

Open pampelmuse76 opened this issue 4 years ago • 3 comments

A python program, which does not determine in the prolog part, cannot be stopped by entering Ctrl-C.


#!/usr/bin/python from pyswip import Prolog prolog = Prolog() prolog.assertz(""" f(X) :- X #> 0, f(X) """) for result in prolog.query("f(X)"): print(result["X"])

Python 3.9.1 pyswip 0.2.10 SWI-Prolog version 8.2.3 for x86_64-linux

pampelmuse76 avatar Dec 28 '20 16:12 pampelmuse76

Did you try: prolog.query("f(X)", catcherrors=False) ?

On Mon, Dec 28, 2020 at 8:04 AM pampelmuse76 [email protected] wrote:

A python program, which does not determine in the prolog part, cannot be stopped by entering Ctrl-C.

#!/usr/bin/python from pyswip import Prolog prolog = Prolog() prolog.assertz(""" f(X) :- X #> 0, f(X) """) for result in prolog.query("f(X)"): print(result["X"])

Python 3.9.1 pyswip 0.2.10 SWI-Prolog version 8.2.3 for x86_64-linux

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yuce/pyswip/issues/115, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3QJLFYXPP4OFDC4NYWZRDSXCUCHANCNFSM4VMGBDLQ .

allComputableThings avatar Dec 28 '20 16:12 allComputableThings

Yes, with catcherrors=False and catcherrors=True. Neither works.

pampelmuse76 avatar Dec 28 '20 16:12 pampelmuse76

Sending a kill signal (TERM) to the process id is working (it determines the program)

pampelmuse76 avatar Dec 28 '20 16:12 pampelmuse76