How to print what arguments the Python function requires / resolves?

Suppose I have a function, and I want to print the arguments that it takes. How can i do this?

+3
source share
4 answers

Use inspect.getargspec()to find out.

+6
source

I see that someone has already suggested the answer that I had in mind, so I offer a purely practical one. IDLE will provide you with the function parameters as a "hint".

This should be enabled by default; the prompt appears immediately after entering the function name and the left bracket.

IDLE doc, python - , , , IDLE.

, , IDLE, , .

+2

help .

, , docstrings .

0

IPython ( ),

foo?

, , :

foo??

( )

-1

Source: https://habr.com/ru/post/1733848/


All Articles