Subprocess puzzle and two questions

Roy Smith roy at panix.com
Wed Nov 14 05:41:24 CET 2012


In article <mailman.3664.1352867713.27098.python-list at python.org>,
 wrw at mac.com wrote:

> I need to time the operation of a command-line utility (specifically 
> nslookup) from within a python program I'm writing.

Ugh.  Why are you doing this?  Shelling out to nslookup is an incredibly 
slow and clumsy way of doing name translation.  What you really want to 
be doing is calling getaddrinfo() directly.

See http://docs.python.org/2/library/socket.html#socket.getaddrinfo for 
details.


More information about the Python-list mailing list