a guest Apr 19th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     """
  2.    First this checks if we already have a console. Then, if there is no console and attach parameter is set, it tries
  3.    to attach to the console of any parent process. If that is not successful and the create parameter is set, it tries
  4.    to create a new console. If that is not successful either, it fails.
  5.    If a console was found, it will set the window title and redirect current output handles to this console.
  6.    """
  7.     std_out_handle = ctypes.windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
  9.     has_console = std_out_handle > 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand