# Debugging python code in VSCODE

**URL:** <https://discourse.nodered.org/t/debugging-python-code-in-vscode/31550>\
**Category:** Developing Nodes\
**Created:** [14 August 2020 09:17 UTC](https://discourse.nodered.org/t/debugging-python-code-in-vscode/31550 "2020-08-14T09:17:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VC-07](https://avatars.discourse-cdn.com/v4/letter/v/b5a626/32.png) [@VC-07](https://discourse.nodered.org/u/VC-07)\
**Post date:** [14 August 2020 09:17 UTC](https://discourse.nodered.org/t/debugging-python-code-in-vscode/31550/1 "2020-08-14T09:17:24Z")

</div>

## ABOUT DEBUGGING CUSTOM NODE DEVELOPMENT

* * *

### 1. How to debug custom python code which is present inside js function for custom python node development in node-red. ?

### 2. How to use VSCODE debugging capabilities to debug node-red console errors ?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 August 2020 09:33 UTC](https://discourse.nodered.org/t/debugging-python-code-in-vscode/31550/2 "2020-08-14T09:33:04Z")

</div>

Hi, welcome to the forum.

I've moved your category from core development (which is about the development of Node-RED itself) to "Creating Nodes".

Also, you've managed to get all of your text in bold somehow which seems a bit "shouty" 🙂 It is hard to read for aging eyes like mine ☹

* * *

To answer your questions ...

> [@VC-07](#):
>
> How to debug custom python code which is present inside js function for custom python node development in node-red. ?

You can't really. There is a node that lets you write Python in what looks like a function node (I've never used it). Or you can run external Python code via the exec node.

In the 2nd case, you can use standard Python tools if you know how to add a debugging interface to a Python app.

Node-RED is built on Node.js (JavaScript). Any connection to Python is incidental.

Another way to interface between the 2 would be to create a Python daemon (server) app - effectively a Python-based API server. Then with both that and Node-RED running, you could easily use the TCP, HTTP or Websocket features of Node-RED to communicate with your Python server. This is actually a lot easier than it sounds.

> [@VC-07](#):
>
> 1. How to use VSCODE debugging capabilities to debug node-red console errors ?

This has been written up a few times, try a search through the forum.

Here are a couple of my own related blog posts:

- [Analysing the Performance of Node-RED | Much Ado About IT](https://it.knightnet.org.uk/kb/nr-qa/analysing-performance/)
- [Node-RED - How to use the Visual Studio Code debugger | Much Ado About IT](https://it.knightnet.org.uk/kb/nr-qa/vscode-debugger/)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 October 2020 09:33 UTC](https://discourse.nodered.org/t/debugging-python-code-in-vscode/31550/3 "2020-10-13T09:33:12Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
