Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get help on methods in Python? [duplicate]

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?

like image 876
user2469848 Avatar asked Aug 31 '25 10:08

user2469848


1 Answers

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.
like image 107
jamylak Avatar answered Sep 03 '25 01:09

jamylak