Go to Run => Edit Configurations, click on "+" => Python Remote Debug
In "Local Host name " enter ip or host name of your local machine. Enter a available port in "Port :"
Give a name, here it's "NSO debug".
The debug tool uses pydevd-pycharm library to attach to the local debug server we just created.
python -m pip install pydevd-pycharm
Select NSO Debug and click on the green bug (or Shift + F9).
The debug server is now listening on port 8885
Insert the following code in the callback function of the service/action (change host and port) :
pydevd_pycharm.settrace('host', port=port, stdoutToServer=True, stderrToServer=True)
That's all , now the service/action callback will try to reach the debug server (don't forget to do a packages reload)
You can now debug with pycharm :
And have full information about the variables :
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: