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
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
I am now using Arduino for communicating with python by using Pyserial to sending data from python to Arduino.But I confused about SoftwareSerial and serial.
Can anyone tell me simply what is that?
SoftwareSerial is a library that was developed to ensure that any pins of Arduino can exchange Serial data with other peripherals, like GNSS receivers, using software.
Of course, it has some limitations, check this website out if you want some examples.
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')
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
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 8 years ago.
Improve this question
I'm sorry that this is probably a re-post of some description, however I couldn't find a question that gave me the answer I need.
I'm coding a basic chat server in Python, and I can get the clients to interact perfectly, however, the clients will only receive data after they have sent some.
I need the clients to be able to receive data at any point.
Does anyone have an example of some code I could look at to see how this could be done, or just a worded explanation of how to do it?
That's a really long story.
You could start by looking at Python's asynchat. Next, you might consider looking at Twisted.
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 9 years ago.
Improve this question
I'm trying to write my own protocol so that multiple servers can pass data and connect with each other, kind of like mongo://. I have been looking at TCP & I understand ports, but how do I write something so that people can just do something like connect("proto://example.com:6767/") ?
Also, I'm writing in python.
Thanks!
I believe you need to look into urllib2 and writing a subclass of BaseHandler, specifically the functions protocol_request and protocol_response.
Whether the way urllib2 handles request/response cycles suits your application is up to you to decide -- it may or may not be exactly what you want.