Lesen der Python -Dokumentation für Drittanbietermodule
-
19-09-2019 - |
Frage
Ich habe kürzlich das Imdbpy -Modul heruntergeladen. Wenn ich das tue,
import imdb
help(imdb)
Ich bekomme nicht die vollständige Dokumentation. Ich muss tun
im = imdb.IMDb()
help(im)
um die verfügbaren Methoden anzuzeigen. Ich mag diese Konsolenschnittstelle nicht. Gibt es eine bessere Möglichkeit, den Dokument zu lesen? Ich meine alle Dokumente zu tun Modul IMDB in einer Seite..
Lösung
Verwenden Pydoc
pydoc -w imdb
Dies erzeugt IMDB.html im selben Verzeichnis.
pydoc -p 9090
Starten Sie einen HTTP -Server auf Port 9090 und Sie können alle Dokumentation bei durchsuchen http: // localhost: 9090/
Andere Tipps
in Ipython du könntest es tun
[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 >
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow