Is there a framework equivalent to Guice (http://code.google.com/p/google-guice) for Python?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Will leave my 5 cents here :)
https://pypi.python.org/pypi/dependency_injector
UPDATED
Some time passed and Dependency Injector is a bit different now. It's better to start from Dependency Injector GitHub page for getting actual examples - https://github.com/ets-labs/python-dependency-injector
If you prefer a really tiny solution there's a little function, it is just a dependency setter.
https://github.com/liuggio/Ultra-Lightweight-Dependency-Injector-Python
I haven't used it, but the Spring Python framework is based on Spring and implements Inversion of Control.
There also appears to be a Guice in Python project: snake-guice
Spring Python is an offshoot of the Java-based Spring Framework and Spring Security, targeted for Python. This project currently contains the following features: