Python获取主机名

import socket
print socket.gethostname()

 

posted @ 2018-01-02 20:15  413Xiaol  阅读(3442)  评论(0编辑  收藏  举报