Leggere la documentazione Python per i moduli 3rd party
-
19-09-2019 - |
Domanda
Di recente ho scaricato il modulo IMDbpy .. Quando lo faccio,
import imdb
help(imdb)
io non ottenere la documentazione completa .. devo fare
im = imdb.IMDb()
help(im)
per vedere i metodi disponibili. Non mi piace questa interfaccia della console. C'è un modo migliore di leggere il doc. Voglio dire tutta la doc relativa a modulo imdb in una sola pagina. .
Soluzione
pydoc -w imdb
Questo genererà imdb.html nella stessa directory.
pydoc -p 9090
inizierà un server HTTP sulla porta 9090, e sarete in grado di navigare tutta la documentazione in http: // localhost: 9090 /
Altri suggerimenti
IPython si potrebbe fare
[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 >
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow