问题
whenever I use help()
on a method I get a weird looking output.
For example, help(obj.readline)
gives me the following output:
Help on built-in function readline:
readline(...)
That's all i get. I don't know how to interpret it.Why there is no description about the method? Can somebody please explain to me what's going on?
回答1:
Is this weird output?
>>> f = open('data.txt')
>>> help(f.readline)
Help on built-in function readline:
readline(...)
readline([size]) -> next line from the file, as a string.
Retain newline. A non-negative size argument limits the maximum
number of bytes to return (an incomplete line may be returned then).
Return an empty string at EOF.
来源:https://stackoverflow.com/questions/17018187/how-to-get-help-on-methods-in-python