added support as a script and a little fix
tested on python2 and python3