def fix_script(path):<EOL>
<EOL>if os.path.isfile(path):<EOL><INDENT>with open(path, '<STR_LIT:rb>') as script:<EOL><INDENT>firstline = script.readline()<EOL>if not firstline.startswith(b'<STR_LIT>'):<EOL><INDENT>return False<EOL><DEDENT>exename = os.environ.get('<STR_LIT>', sys.executable).encode(sys.getfilesystemencoding())<EOL>firstline = b'<STR_LIT>' + exename + os.linesep.encode("<STR_LIT:ascii>")<EOL>rest = script.read()<EOL><DEDENT>with open(path, '<STR_LIT:wb>') as script:<EOL><INDENT>script.write(firstline)<EOL>script.write(rest)<EOL><DEDENT>return True<EOL><DEDENT>return None<EOL>
Replace #!python with #!/path/to/python
    Return True if file was changed.