GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Program Files (x86)/Certbot/pkgs/pythonwin/pywin/tools/ |
Upload File : |
# win32traceutil like utility for Pythonwin import _thread import win32trace, win32event, win32api from pywin.framework import winout outputWindow = None def CollectorThread(stopEvent, file): win32trace.InitRead() handle = win32trace.GetHandle() # Run this thread at a lower priority to the main message-loop (and printing output) # thread can keep up import win32process win32process.SetThreadPriority(win32api.GetCurrentThread(), win32process.THREAD_PRIORITY_BELOW_NORMAL) try: while 1: rc = win32event.WaitForMultipleObjects((handle, stopEvent), 0, win32event.INFINITE) if rc == win32event.WAIT_OBJECT_0: # About the only char we can't live with is \0! file.write(win32trace.read().replace("\0", "<null>")) else: # Stop event break finally: win32trace.TermRead() print("Thread dieing") class WindowOutput(winout.WindowOutput): def __init__(self, *args): winout.WindowOutput.__init__(*(self,)+args) self.hStopThread = win32event.CreateEvent(None, 0, 0, None) _thread.start_new(CollectorThread, (self.hStopThread, self)) def _StopThread(self): win32event.SetEvent(self.hStopThread) self.hStopThread = None def Close(self): self._StopThread() winout.WindowOutput.Close(self) # def OnViewDestroy(self, frame): # return winout.WindowOutput.OnViewDestroy(self, frame) # def Create(self, title=None, style = None): # rc = winout.WindowOutput.Create(self, title, style) return rc def MakeOutputWindow(): # Note that it will not show until the first string written or # you pass bShow = 1 global outputWindow if outputWindow is None: title = "Python Trace Collector" # queueingFlag doesnt matter, as all output will come from new thread outputWindow = WindowOutput(title, title) # Let people know what this does! msg = """\ # This window will display output from any programs that import win32traceutil # win32com servers registered with '--debug' are in this category. """ outputWindow.write(msg) # force existing window open outputWindow.write('') return outputWindow if __name__=='__main__': MakeOutputWindow()