[Tutor] Sloppy Code ?
matt.erasmus at gmail.com
Mon Nov 13 20:10:39 CET 2006
Yes, that does help, although it doesn't print the FQDN which is what
I'm really after.
But thanks to you I now know about the socket module (is that the
right terminology ?) and using the Python script in Vim I found
socket.getfqdn() which prints exactly what I needed...
So my code goes from:
stdin, stdout, stderr = os.popen3('/bin/hostname -f')
system_name = stdout.read()
On 13/11/06, Michael Lange <klappnase at freenet.de> wrote:
> import socket
> print socket.gethostname()
> I hope this helps
Thanks so much Michael
More information about the Tutor