Как в интерпретаторе получить полную информацию о библиотеках и расшифровать ее?
Какие команды нужно вводить dir(urllib) или help(urllib)? Где почитать можно об этом?
[code python]>>> import urllib
>>> dir(urllib)
[code python]>>> import urllib
>>> dir(urllib)
['__builtins__', '__cached__', '__doc__', '__file__', '__initializing__', '__loader__', '__name__', '__package__', '__path__', 'error', 'parse', 'request', 'response']
>>>
[/code]
ingfa_1981обе
Какие команды нужно вводить dir(urllib) или help(urllib)?
print(object.__doc__)
>>> dir(print) ['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__'] >>> >>> dir(print.__call__) ['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__name__', '__ne__', '__new__', '__objclass__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__'] >>> >>> print(print.__doc__, print.__call__.__doc__, sep='\n***\n') print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) Prints the values to a stream, or to sys.stdout by default. Optional keyword arguments: file: a file-like object (stream); defaults to the current sys.stdout. sep: string inserted between values, default a space. end: string appended after the last value, default a newline. flush: whether to forcibly flush the stream. *** x.__call__(...) <==> x(...) >>> >>> help(print) >>> >>> help(print.__call__) >>>
print(print.__doc__, print.__call__.__doc__, sep='\n***\n'
ingfa_1981там две справки: print.__doc__ и print.__call__.__doc__
это и есть справка о том как вводить данные в инструкцию print?
>>> def f(): ... 'documentation' ... return 1 ... >>> print(f.__doc__) documentation >>>
ingfa_1981можно отредактировать
Скобочку не докопировал