Best way to trigger a Node-RED flow from python script [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm running Node-RED on a raspberry pi. I want to trigger a flow at the end of a python script I'm running on the same rpi. What's the easiest input node to trigger and what would be an example of the python code to use with it? I'd like to pass a string variable back

Taking best to be easiest then the http-in node is probably best
And using something like this will work:
import urllib2
urllib2.urlopen("http://localhost:1880/start").read()
Where the http-in node has been configured to listen on /start

Related

Check computer is connected to Wifi or Ethernet programmatically using Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I need to check whether the system is connected to WiFi or Ethernet using Python, is there any way to do so?
I have searched a lot but haven't found any way to check it via Python.
import os
os.system('netsh interface show interface')

How do I code a minecraft CLIENT/mod with python, instead of java? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I want to code a custom client for minecraft with python.
I want to be able to change the text of some menu buttons in the game 'minecraft'.
I don't want to use java, but python. Again, I get how to make a minecraft SERVER with python, but I wan't to make a client. How can I do this, if it is possible?
Minecraft is developed in Java so, if you want to edit the code to create a custom client you should do it in Java, if you want explicitly use Python you can call a script from Python to Java.
Here are some ways you can achieve this: https://www.baeldung.com/java-working-with-python
If you only want to change the menu buttons here is a tutorial you can follow: https://www.youtube.com/watch?v=kPN3-lQP-Y0&ab_channel=GreatOrator

Detect port scanning on all ports [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am looking to create a Python script that alerts me when any port (all) on my computer is touched/interacted with. I have absolutely no clue where to start so any resource that could point me in the right direction would be greatly appreciated.
I want to use a Rasberry Pi 3. (Edit: Sorry for not including this)
Depends on what you need from the solution, you can use:
for testing and if you don't mind packets missing when you process them too slow: https://pypi.python.org/pypi/pcapy
if you want to react to the packets in any way: forward the packets from the iptables to NFQUEUE and process using https://pypi.python.org/pypi/NetfilterQueue

Executing shell/ssh commands via web app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I would like to run commands on my home server via a web app. Is there a way to do this?
I have no interest in returning the output, I just want to execute commands like irsend when a button is pressed on the page.
You can't execute commands directly from the browser, that is why child_process.exec() does not work when browserify your code.
You will need to send an HTTP request of some kind to the server and have it run the command there instead (using child_process.exec()/child_process.spawn()).

Realtime collaboration in Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Is there any known way to do realtime collaboration stuff (like Google Docs) in Python (not thru the browser)? I'm working on a program, and would like to add said feature to it.
Thanks
You can try Dweet, which is a service that stores JSON data in key values pairs. You can use one of the client libraries listed on their website or you could simply make a request like so:
urllib.urlopen('https://dweet.io/dweet/for/my-thing-name?dweet=awesome')

Categories