Python获取主机名

import socket
print socket.gethostname()
原文地址:https://www.cnblogs.com/413xiaol/p/8178939.html