PyQt Connect to Hosts

This example has a few tricks:

Piling a few tree widget items based on a string list of host IP address, and each host will get a thread trying to ping the relevant address by:

os.popen('ping -q -c2 '+addr,'r')

Whether the host is available is decided by scanning the resulting file to look for ‘100% packet loss’. The decision will be send within a signal to trigger a specific tree widget item to show up green or red icon. And it uses timer.timeout signal to run all those threads every 30 seconds

Get the source here.

Advertisements

Leave a comment

Filed under Python

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s