Machine Name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Harlin Seritt

    #1

    Machine Name

    How does one get the machine name with Python that the actual script is
    running on? Obviously, one could parse the hosts file but I was
    wondering if there was a quick way to get it done?

    thanks,

    Harlin Seritt

  • Steve Holden

    #2
    Re: Machine Name

    Harlin Seritt wrote:[color=blue]
    > How does one get the machine name with Python that the actual script is
    > running on? Obviously, one could parse the hosts file but I was
    > wondering if there was a quick way to get it done?
    >
    > thanks,
    >
    > Harlin Seritt
    >[color=green][color=darkred]
    >>> from socket import gethostname
    >>> gethostname()[/color][/color][/color]
    'bigboy'[color=blue][color=green][color=darkred]
    >>>[/color][/color][/color]

    regards
    Steve
    --
    Steve Holden +44 150 684 7255 +1 800 494 3119
    Holden Web LLC http://www.holdenweb.com/

    Comment

    Working...