📜  如何在 python 代码示例中打印主机名

📅  最后修改于: 2022-03-11 14:45:14.359000             🧑  作者: Mango

代码示例1
# 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())