#!/usr/bin/env python

import os
import sys
import glob

pypath = raw_input('Python path: ')
if not os.path.exists(pypath):
    print '%s does not exist.' % pypath
    sys.exit()

for file in glob.glob('*.py'):
    if not file.endswith('setpath.py'):
        f = open(file)
        f.readline()
        str = f.read()
        f.close()

        f = open(file, 'w')
        f.write('#!' + pypath + '\n')
        f.write(str)
        f.close()


