OrderedDict for older versions of python

前端 未结 7 2133
春和景丽
春和景丽 2020-11-27 17:59

Ordered dictionaries are extremely useful structures, but unfortunately these are quite recent only working in versions from 3.1 and 2.7. How can I use an ordered dictionary

7条回答
  •  孤独总比滥情好
    2020-11-27 18:18

    in python2.6 gave to me:

    $ pip install ordereddict
      Could not find a version that satisfies the requirement from (from versions:)
    No matching distribution found for from
    

    but

    $ easy_install ordereddict
    install_dir /usr/local/lib/python2.6/dist-packages/
    Searching for ordereddict
    Reading http://pypi.python.org/simple/ordereddict/
    Best match: ordereddict 1.1
    Downloading https://pypi.python.org/packages/source/o/ordereddict/ordereddict-1.1.tar.gz#md5=a0ed854ee442051b249bfad0f638bbec
    Processing ordereddict-1.1.tar.gz
    Running ordereddict-1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-lYgPE3/ordereddict-1.1/egg-dist-tmp-GF2v6g
    zip_safe flag not set; analyzing archive contents...
    Adding ordereddict 1.1 to easy-install.pth file
    
    Installed /usr/local/lib/python2.6/dist-packages/ordereddict-1.1-py2.6.egg
    Processing dependencies for ordereddict
    Finished processing dependencies for ordereddict
    

    did.

提交回复
热议问题