Managing resources in a Python project

You may want to use pkg_resources library that comes with setuptools. For example, I’ve made up a quick little package “proj” to illustrate the resource organization scheme I’d use: proj/setup.py proj/proj/__init__.py proj/proj/code.py proj/proj/resources/__init__.py proj/proj/resources/images/__init__.py proj/proj/resources/images/pic1.png proj/proj/resources/images/pic2.png Notice how I keep all resources in a separate subpackage. “code.py” shows how pkg_resources is used to refer to … Read more

When should I use jQuery deferred’s “then” method and when should I use the “pipe” method?

Since jQuery 1.8 .then behaves the same as .pipe: Deprecation Notice: As of jQuery 1.8, the deferred.pipe() method is deprecated. The deferred.then() method, which replaces it, should be used instead. and As of jQuery 1.8, the deferred.then() method returns a new promise that can filter the status and values of a deferred through a function, … Read more