4

I recently downloaded IMDbpy module.. When I do,

import imdb
help(imdb)

i dont get the full documentation.. I have to do

im = imdb.IMDb()
help(im)

to see the available methods. I dont like this console interface. Is there any better way of reading the doc. I mean all the doc related to module imdb in one page..

N 1.1
  • 12,418
  • 6
  • 43
  • 61
shadyabhi
  • 16,675
  • 26
  • 80
  • 131

2 Answers2

10

Use pydoc

pydoc -w imdb

This will generate imdb.html in the same directory.


pydoc -p 9090 will start a HTTP server on port 9090, and you will be able to browse all documentation at http://localhost:9090/

N 1.1
  • 12,418
  • 6
  • 43
  • 61
  • I tried.. But, still I am not getting the methods of "im" in the doc html – shadyabhi Mar 13 '10 at 09:43
  • I still didnt get the methods of "im" in the doc.. Why was the answer upvoted...? – shadyabhi Mar 13 '10 at 09:46
  • what function you are not able to see in `pydoc -p` ? I can see company, person, movie, etc classes with all functions in it. – N 1.1 Mar 13 '10 at 09:54
  • sorry, if this is silly.. But, I am still not seeing the method "ia.search_movie()" in the docs.. – shadyabhi Mar 13 '10 at 09:59
  • @Shadyabhi: the documentation for above method can be found at 'Parser(package) -> http(package)' or http://localhost:1234/imdb.parser.http.html (if your server is running). I have no idea why the documentation is there, but it is present :). – N 1.1 Mar 13 '10 at 10:13
  • Oh. I got it.. pydoc can be used to see the full documentation. You just have to search for the proper place.. Thanx – shadyabhi Mar 13 '10 at 10:16
1

in IPython you could do

[1]: import os
[2]: os?

< get the full documentation here >

# or you could do it on specific functions 
[3]: os.uname
<built-in function>



[4]: os.uname?

< get the full documentation here >


# Incase of modules written in python, you could inspect source code by doing
[5]: import string
[6]: string??

< hows the source code of the module >

[7]: string.upper??

< shows the source code of the function >
Jeffrey Jose
  • 1,992
  • 2
  • 16
  • 21