In modern versions of Python, `print` is now a function, and there are ways of working around that limitation in a Python2/3 compatible way, but there's a better way of handling messages like this.

If, at the top of your module, you import ``logging``, and create a ``logger`` instance --

```
import logging

logger = logging.getLogger(__name__)
```

you can send warning/error/info messages to that logger.  Users, then, will see this message in their logs (if properly configured), or can otherwise do interesting things with outgoing logging messages.

In this case, I'd probably do the above, and change this set of `print` statements to just something like:

```
logger.warning("ValueError: %s working on %s" % (e, each_msg[0]))
```