Tag Archives: python3

[python]Excluding ip addresses belonging a subnet

suppose if you need to enumerate ip addresses from a list, but want to exclude ip addresses belonging to a subnet here’s a solution which you can do with netaddr module. Supposed ip_from_inventory is the list of ip addresses you … Continue reading

Posted in Python, Scripting | Tagged , | Leave a comment

[python]Writing to temporary file

Supposed you have collected a list item known as ip_collections, and you want to write the list to a temp file. Need to convert the string in byte, the tf.seek(0) is to re-wind the pointer back to the start of … Continue reading

Posted in Python, Scripting | Tagged , | Leave a comment