def wait_and_close_handle(process_handle):
 WaitForSingleObject(process_handle, INFINITE)
 CloseHandle(process_handle)

def wait_and_close_handle ( process_handle ) : WaitForSingleObject ( process_handle , INFINITE ) CloseHandle ( process_handle )
waits till spawned process finishes and closes the handle for it parameters process_handle : handle the windows handle for the process .