On Jul 26, 9:10 pm, "Jose Galvez" <[EMAIL PROTECTED]> wrote: > I know that is really has nothing to do with pylons, but I know this group > is pretty knowledgeable. I need to get the host name from a computer, I > know its IP address so I was using socket.gethostbyaddr(ip) which works for > my windows computers, however I have a computer that is running OSX and when > I use socket.gethostbyaddr(ip) with its IP I get 'host not found'. Ive > edited the hostconf file adding the full hostname for the computer there but > it still does not work. I'm at a loss, does anyone know how to make OSX > give me its hostname?
Here's 2 methods: >>> from socket import gethostname; print gethostname() >>> os.uname()[1] Cheers, Chris Miles --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
