@staticmethod<EOL><INDENT>def _adjust_header(type_, orig_header):<DEDENT>
pattern = '<STR_LIT>'<EOL>repl = '<STR_LIT>'<EOL>if type_ == '<STR_LIT>':<EOL><INDENT>pattern, repl = repl, pattern<EOL><DEDENT>pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE)<EOL>new_header = pattern_ob.sub(string=orig_header, repl=repl)<EOL>clean_header = new_header[<NUM_LIT:2>:-<NUM_LIT:1>].strip('<STR_LIT:">')<EOL>if sys.platform == '<STR_LIT:win32>' and not os.path.exists(clean_header):<EOL><INDENT>return orig_header<EOL><DEDENT>return new_header<EOL>
Make sure 'pythonw' is used for gui and and 'python' is used for
console (regardless of what sys.executable is).