print process_log_message log_to_file(process_log_messageexceptpass we start by instantiating the wmi class and then telling it to watch for the process creation event by reading the python wmi documentationwe learn that you can monitor process creation or deletion events if you decide that you' like to closely monitor process eventsyou can use the operation and it will notify you of every single event process goes through we then enter loopand the loop blocks until process_watcher returns new process event the new process event is wmi class called win _process[ that contains all of the relevant information that we are after one of the class functions is getownerwhich we call to determine who spawned the process and from there we collect all of the process information we are looking foroutput it to the screenand log it to file