rewritten for python 3

rewritten for python 3, to solve several issues with the win32com
package