How do I get my computer's fully qualified domain name in Python?

后端 未结 1 1740
[愿得一人]
[愿得一人] 2020-12-10 00:26

I know I can use platform.node() to get my computer\'s network name:

>>> import platform
>>> platform.node()
\'MyComputerName\'


        
相关标签:
1条回答
  • 2020-12-10 01:01

    The fully qualified domain name is returned by socket.getfqdn().

    0 讨论(0)
提交回复
热议问题