parameters: (filename, shebang)
docstring: Replace shebang line / reheader script files
docstring_summary: Replace shebang line / reheader script files
docstring_tokens: Replace shebang line / reheader script files
function: def replace_shebang(filename, shebang):
      """ Replace shebang line / reheader script files """
      print >>sys.stderr, "Fixing shebang line in " + filename
  
      with open(filename) as f:
          lines = f.readlines()
  
      with open(filename, "w") as f:
          removed = False
          print >> f, shebang
          for i, l in enumerate(lines):
              if not removed and l.startswith("#!") and i < 10:
                  removed = True
              else:
                  f.write(l)
function_tokens: def replace_shebang ( filename , shebang ) : print >> sys . stderr , "Fixing shebang line in " + filename with open ( filename ) as f : lines = f . readlines ( ) with open ( filename , "w" ) as f : removed = False print >> f , shebang for i , l in enumerate ( lines ) : if not removed and l . startswith ( "#!" ) and i < 10 : removed = True else : f . write ( l )