dict_items-Objekt hat kein Attribut 'Art'Replace Min
Zunächst ich bin neu in Python. Ich bin mit PTVS http://pytools.codeplex.com/. Weiter habe ich installiert reportlab. Dann habe ich eine Probe-demo bei https://github.com/nakagami/reportlab/blob/master/demos/colors/colortest.py#L68 Aber an der Linie,
all_colors = reportlab.lib.colors.getAllNamedColors().items()
all_colors.sort() # alpha order by name
Bin ich immer Fehler, dict_items object has no attribute sort
InformationsquelleAutor user960567 | 2015-01-20
Du musst angemeldet sein, um einen Kommentar abzugeben.
Noch nicht getestet, aber eine Theorie: Sie sind mit Python ist3!
Vom https://docs.python.org/3/whatsnew/3.0.html
wie ich es verstehe, ein "view" ist ein iterator, iterator nicht die Funktion Sortieren. Ändern Sie es zu
gemäß der Dokumentation
InformationsquelleAutor Johan
Damit die gesamte Lösung basiert auf Johan ' s Antwort ist:
InformationsquelleAutor Klamer Schutte