[[email protected] python]# Pythonpython 2.7.5 ( Default, June, 18:11:42) [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on Linux2type "help", "copyright", "credits" or "L Icense "For more information.>>> import socket>>> Help (Socket.gethostname) Help on built-in function GetHostName in Module _socket:gethostname (...) GetHostName (), string Return the current host name.>>> help (socket.gethostbyname) to built-in FU Nction gethostbyname in Module _socket:gethostbyname (...) gethostbyname (host), address Return the IP address (a string of the form ' 255.255.255.255 ') for a host.>> ;>
Description:
Import socket: Import one of the core network libraries provided by Python
Help (Socket.gethostname): View the helpful information
GetHostName: No parameters, returns the name of the host or local host
GetHostByName: receives a parameter hostname, returns the corresponding IP
copyright notice: This article for Bo Master original article, without Bo Master permission not reproduced.
How Python looks at function functions, similar to the man under Linux