First time here? Check out the FAQ!
1

What does debug process is busy mean?

Hi,

After running some code in the Python debugger

(https://www.openbookproject.net/py4fun/prolog/prolog1.py)

, and typing a statement at the >>> prompt:

 a = prolog.Term("mother(alice,bill)")

Wing won't continue, and returns an error:

 Cannot execute: debug process is busy

Note that the prolog1.py code was written for version 2, so some changes had to be made, like using parenthesses with print. So the current code module is not exactly the same as the one above.

wpCurious's avatar
61
wpCurious
asked 2021-04-05 20:56:45 -0600
Wingware Support's avatar
4.2k
Wingware Support
updated 2021-04-06 08:08:39 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

I think the code "procFile (sys.stdin,'? ')" in main() in prolog1.py is reading from stdin, and thus you are trying to enter code into the Debug Console while you are not at a breakpoint or exception. If you want to use this code interactively, you may want to set a breakpoint on the first line of main() and run to that, then enter your interactive code.

Wingware Support's avatar
4.2k
Wingware Support
answered 2021-04-06 08:05:44 -0600
edit flag offensive 0 remove flag delete link

Comments

Thanks, I gave it a try. But since the class hasn't been constructed yet when I try to generate an instance of it with

 a = prolog.Term("mother(alice,bill)")

, it generates an error

 Traceback (most recent call last):
   Debug Console, prompt 1, line 1
 builtins.NameError: name 'prolog' is not defined

It looks like the module also accepts a file, but I tried giving it a file as well. Same problem.

wpCurious's avatar wpCurious (2021-04-06 09:22:17 -0600) edit

If you debug/run the file then the 'if __name__ == "__main__"' clause at the bottom will be true and it'll invoke main() right away. Unless that reaches an exception or breakpoint the Debug Console cannot invoke code because it's run in the context of the current debug stack frame. If instead you do 'import prolog1' (for example in Wing's Python Shell; this assumes prolog1 is on your Python Path) then the module will be loaded so you can do things like prolog.Term("whatever"). Or set a breakpoint on the last line of the file, debug it, and then work in the Debug Console. The latter is what I would tend towards doing to work interactively with this.

Wingware Support's avatar Wingware Support (2021-04-06 09:49:18 -0600) edit
add a comment see more comments
0

I think I need to play with this a bit, and trace through the procfile routine. It's possible that I'm misunderstanding how the module is supposed to work.

I'll return here and post results, in case there are any future interested parties.

wpCurious's avatar
61
wpCurious
answered 2021-04-06 09:27:30 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer