Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to print hostname in python

# Use socket and its gethostname() functionality. 
# This will get the hostname of the computer where the Python interpreter is running:
import socket
print(socket.gethostname())
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #print #hostname #python
ADD COMMENT
Topic
Name
7+1 =