Python 获取主机名

import socket
print socket.gethostname()
原文地址:https://www.cnblogs.com/wangjq19920210/p/9726145.html