Converted to IronPython

For use in TMW pythonshell