
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
node-red-contrib-python-function-ps
Advanced tools
install via npm or Node-RED palette manager.
npm install node-red-contrib-python-function-ps --save
Like function node, write python code instead javascript code and run.
# user code here.
a = 1234
node.globals["a"] = a
del node.globals["a"]
write_output("a", a)
msg["payload"] = read_input("a")
return msg
[{"id":"382690a637ad27e8","type":"inject","z":"588e7dc76a18c895","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":200,"wires":[["c10a056d2aa1dea0"]]},{"id":"412d6d40234f18ed","type":"debug","z":"588e7dc76a18c895","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":200,"wires":[]},{"id":"c10a056d2aa1dea0","type":"python-function-ps","z":"588e7dc76a18c895","name":"","pythonPathType":"global","pythonPath":"python3","globalPythonName":"pythonPath","importPathList":[],"fnCodePre":"\n# user code here.\n\nreturn msg\n","fnCode":"\n# user code here.\n\nmsg[\"T\"] = { \"a\": 1, \"b\": 2 }\n\nreturn msg\n","fnCodePost":"\n# user code here.\n\nreturn msg\n","x":350,"y":200,"wires":[["651e7099d7f27af8"]]},{"id":"651e7099d7f27af8","type":"python-function-ps","z":"588e7dc76a18c895","name":"","pythonPathType":"global","pythonPath":"python3","globalPythonName":"pythonPath","importPathList":[],"fnCodePre":"\n# user code here.\n\nreturn msg\n","fnCode":"\n# user code here.\n\nmsg[\"payload\"] = msg.pop(\"T\")\n\nreturn msg\n","fnCodePost":"\n# user code here.\n\nreturn msg\n","x":590,"y":200,"wires":[["412d6d40234f18ed"]]}]
[x] Support for 'node.log', 'node.error' functions.
[x] Support 'global' object for python.
[x] Support 'flow' object for python.
[x] Support for 'additional import paths'.
[ ] More intuitive stacktrace.
0.1.1
FAQs
Function Node for execute python in Node-RED
The npm package node-red-contrib-python-function-ps receives a total of 108 weekly downloads. As such, node-red-contrib-python-function-ps popularity was classified as not popular.
We found that node-red-contrib-python-function-ps demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.