How to view functions in python is similar to the man function in linux.

Source: Internet
Author: User

How to view functions in python is similar to the man function in linux.

[Root @ iZ94gh8l046Z python] # pythonPython 2.7.5 (default, Jun 17 2014, 18:11:42) [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2Type help, copyright, credits or license 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) Help on built-in function gethostbyname in module _ socket: gethostbyname (...) gethostbyname (host)-> address Return the IP address (a string of the form '2017. 255.255.255 ') for a host. >>>

Note:

Import socket: imports a core network library provided by python.

Help (socket. gethostname): View help information

Gethostname: No parameter. The name of the host or local host is returned.

Gethostbyname: receives a parameter hostname and returns the corresponding IP address.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.