Windows event log

I would like to know if it is possible to write a log in windows event logs using a python script. I found some an script that can do that:

win32evtlogutil.ReportEvent(applicationName, eventID, eventCategory=category,
eventType=myType, strings=descr, data=data, sid=my_sid)

the problem is that I need to import win32evtlogutil and it seems that py32win library is not installed.
Have you any idea how to solve my problem?

Tanks in advance.

You can only use python modules in jython if they are pure python – native library bindings won’t work. In these situations, you must look for a similar java approach to the problem, or spawn an executable that can do what you want. There are several possible approaches listed on stack overflow.
{ I haven’t done any of this, largely because I treat Windows like the plague. :slight_smile: }

thanks for the information pturmel.

At the end I had to use a batch file that run a vbs to write a log in windows log viewer. It is not a very nice solution but at least it is working :smiley: