Das Importieren von Modul aus der Zeichenfolgevariable mit "__import__" ergibt unterschiedliche Ergebnisse als eine norm

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Das Importieren von Modul aus der Zeichenfolgevariable mit "__import__" ergibt unterschiedliche Ergebnisse als eine norm

by Guest » 05 Feb 2025, 12:31

Ich arbeite an einer Dokumentation (persönlich) für die verschachtelte Matplotlib (MPL) -Bibliothek, die sich von interessierten Submodul -Paketen von MPL Own unterscheidet. Ich schreibe ein Python -Skript, von dem ich hoffe Verarbeiten Sie es mit pydoc . Hier ist ein Beispiel für das, was ich versucht habe: < /p>

Code: Select all

import matplotlib.text as text
x = dir(text)
< /code>
i = __import__('matplotlib.text')
y = dir(i)
< /code>
j = __import__('matplotlib')
z = dir(j)
< /code>
And here is a 3-way comparison of above lists through pprint:
[img]https://i.sstatic.net/3n7pT.png[/img]

I don't understand what's loaded in y
Objekt - Es handelt sich um Basis -Matplotlib plus etwas anderes, aber es fehlen Informationen, die ich gewünscht habe, und das sind Hauptklassen von Matplotlib.text Paket. Es ist der oberste blau gefärbte Teil auf Screenshot (

Code: Select all

x
Liste).

Top