Simple two way ordered dictionary for Python.
See wiki for more information.
- Download & extract source from here
- Change directory into twodict-1.2/
- Run
sudo python setup.py install
Install From Pypi
- Run
sudo pip install twodict
from twodict import TwoWayOrderedDict
tdict = TwoWayOrderedDict()
tdict['a'] = 1
tdict['b'] = 2
tdict['c'] = 3
print(tdict['a']) # Outputs 1
print(tdict[1]) # Outputs 'a'
del tdict[2]
print(tdict) # TwoWayOrderedDict([('a', 1), ('c', 3)])
Unlicense (public domain)