(cls, type_, orig_header)
return new_header if cls._use_header(new_header) else orig_header
Make sure 'pythonw' is used for gui and and 'python' is used for
        console (regardless of what sys.executable is).
Make sure 'pythonw' is used for gui and and 'python' is used for
        console (regardless of what sys.executable is).
Make sure pythonw is used for gui and and python is used for console ( regardless of what sys . executable is ) .
def _adjust_header(cls, type_, orig_header):
        """
        Make sure 'pythonw' is used for gui and and 'python' is used for
        console (regardless of what sys.executable is).
        """
        pattern = 'pythonw.exe'
        repl = 'python.exe'
        if type_ == 'gui':
            pattern, repl = repl, pattern
        pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE)
        new_header = pattern_ob.sub(string=orig_header, repl=repl)
        return new_header if cls._use_header(new_header) else orig_header
def _adjust_header ( cls , type_ , orig_header ) : pattern = 'pythonw.exe' repl = 'python.exe' if type_ == 'gui' : pattern , repl = repl , pattern pattern_ob = re . compile ( re . escape ( pattern ) , re . IGNORECASE ) new_header = pattern_ob . sub ( string = orig_header , repl = repl ) return new_header if cls . _use_header ( new_header ) else orig_header