This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17024|Reply: 0

[Source] How to use a function in a python package

[Copy link]
Posted on 4/25/2018 10:35:35 AM | | | |
Python help() function

help() function is used to see a detailed description of the purpose of a function or module.

Let's take the requests module as an example, look at the get method, first open the cmd command, enter python, and enter the command as follows:





If you can't see it in full, press enter to show more

Python dir() function

Python built-in functions describe dir() functions without parameters, returning a list of variables, methods, and defined types in the current range; When parameter, returns the parameter's attribute and method list. If the argument contains a method __dir__(), the method will be called. If the parameter does not contain __dir__(), the method will collect the maximum amount of parameter information.







Another way to view function information print(module_name.func_name.__doc__)





Check the Python official website documentation at https://docs.python.org/3.6/library/functions.html




Previous:The image conversion tool in Caffe convert_imageset
Next:python from import and import explained in detail
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com