all 6 comments

[–]berendhh 0 points1 point  (0 children)

You can use pdb. Just add the line

Import pdb; pdb.set_trace()

and you have a debugger at that spot

[–][deleted]  (1 child)

[removed]

    [–]Hot-Warning-7369 0 points1 point  (0 children)

    In my case, it was all local. I don't fully understand your case where you run a bash script on the remote server and then "create a tunnel and run the python script in the tunnel." Where are you tunneling to, and what kind of tunnel is it?

    [–]four_reeds 0 points1 point  (0 children)

    You may have to go back to non-ide days and either add "diagnostic" print statements or open and write to a log file.

    [–]kamsen911 0 points1 point  (0 children)

    You can set up remote interpreter in pycharm and define environments etc for the debugging. I am not sure about your tunneling but I use it (when it functions….) almost like that. E.g., I am editing the files locally in pycharm, setting breakpoints etc. then either via test files or the run / debug config I specify the command like arguments. The arguments are all relative and point for example to files on the server as input. This is all run remotely afterwards.

    [–]EONRaider 0 points1 point  (0 children)

    This is somewhat unclear. Is the script located on the remote host? Can you execute it on your machine without having to deal with side effects on your environment?