Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to debug with intellij idea? #102

Closed
mars1211 opened this issue Jan 22, 2023 · 7 comments
Closed

How to debug with intellij idea? #102

mars1211 opened this issue Jan 22, 2023 · 7 comments

Comments

@mars1211
Copy link

mars1211 commented Jan 22, 2023

Good afternoon. Your work is very interesting.
I'm trying to launch a debag in a similar way:

import pydevd_pycharm
    
pydevd_pycharm.settrace('192.168.56.1', port=38600, stdoutToServer=False, stderrToServer=False, suspend=False)

As a result, the image is displayed, but there is no response to the actions.

I would venture to assume that it's about transferring input to the debugging server, but in the example it is turned off and there is still no response.

In the case without a debug, it works fine.

Here is full code:

#!/usr/bin/env python3
from TermTk import TTkVBoxLayout, TTkButton, TTk

def main():
    import pydevd_pycharm
    pydevd_pycharm.settrace('192.168.56.1', port=38600,
                            stdoutToServer=False, stderrToServer=False, suspend=False)

    root = TTk()

    view = TTkVBoxLayout()
    root.setLayout(view)
    button = TTkButton(border=True, text="Button1")
    view.addWidget(button)
    button.clicked.connect(lambda: print('test'))

    root.mainloop()

if __name__ == "__main__":
    main()
@ceccopierangiolieugenio
Copy link
Owner

ceccopierangiolieugenio commented Jan 22, 2023

Thanks for your feedback, it means a lot to me.

Unfortunately I never used pycharm,
I tried to install the community version but the remote debugger seems available only in the pro.
In pyTermTk, I capture the inputs straight from the tty (maybe this is not the expected way for this debugger),
does pycharm use a different method to handle it?
do you know if I can use a different remote debugger to test it?
It is nice for me to be able to handle as many different environments as possible.

I use the vscode debugger do far I find it very handy and quite easy.

@mars1211
Copy link
Author

To be honest, I haven't found any other methods to handle it.
I work on win, so I have to use remote debugging. So far, the only option is to put a connection to the debug server instead of a breakpoint.

Offtop: Your development is unique, the examples are gorgeous, but there is a great lack of detailed documentation)

@nickandwolf
Copy link

I've been using Replit.com for my work. It uses a linux virtual machine so it runs natively and doubles as an IDE.

@ceccopierangiolieugenio
Copy link
Owner

Under windows I was using WSL and VSCode for windows with the extension to connect to the WSL environment.
But I don't remember how was the debugging using this configuration.

About the documentation, it's true, I am trying to use sphinx but I am struggling to find a way to organise it properly
and I don't know how to configure autodoc to include also the inherithed fields.
I should spend some days just for it.

@ceccopierangiolieugenio
Copy link
Owner

Yes, I managed to debug on windows 10.
image
I use WSL environment for python,
and VSCode with the WSL extension to connect and use that environment.
I don't have to use any extra libraries and the debugger works out of the box.

anyway, I will try to check intellij idea as well

@castben
Copy link

castben commented May 5, 2023

Hi, not sure If my comment is now too late,

I actually work with intellJ on all my python projects (community Edition) and on your initial PyTermTk version I had exactly same issue, when you run within IntellJ using debug Mode IntellJ terminal can't handle properly output and it appear all scrambled.

But if I run my program apart, and then connect my IntellJ instance to debug running pyTermTk program, it somehow works for me.

But is not very seamless as you think, you can stil click on buttons and widget BUT to gain control back and allow IntellJ to continue debug you must do CTRL-J and this will push event into IntellJ and will continue from there until you click in another widget then you must do CTRL-J again to allow event to propagate into Debugger... I know is a bit tedius but I was able to debug my program like this.

Now with your last version of PyTermTK and IntellJ 2023, all works fine, I can see pyTermtk Form rendring correctly on IntellJ terminal and also I can conect to a running PyTermTk program and seamless debug it (without using CTRL-J)

@ceccopierangiolieugenio
Copy link
Owner

I just checked intellij (v2023.1.1) and it works for me as well
It could be that this fix solved this issue #118 -> #119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants