I would like to write a script to do an heavy network upload, in the background. However, I would like it to pause when I am using my computer (either by detecting network activity or keyboard activity or that I am not idle). What is the best way to detect that I am using the computer, on Python on Unix?
Tag: networking
Python: get default gateway for a local interface/ip address in linux
On Linux, how can I find the default gateway for a local ip address/interface using python? I saw the question “How to get internal IP, external IP and default gateway for UPnP”, but the accepted solution only shows how to get the local IP address for a network interface on windows. Thanks. Answer For those people who don’t want an
Python socket receive – incoming packets always have a different size
I’m using the SocketServer module for a TCP server. I’m experiencing some issue here with the recv() function, because the incoming packets always have a different size, so if I specify recv(1024) (I tried with a bigger value, and smaller), it gets stuck after 2 or 3 requests because the packet length will be smaller (I think), and then the
List of IP addresses/hostnames from local network in Python
How can I get a list of the IP addresses or host names from a local network easily in Python? It would be best if it was multi-platform, but it needs to work on Mac OS X first, then others follow. Edit: By local I mean all active addresses within a local network, such as 192.168.xxx.xxx. So, if the IP