def hasSheBang(fname):
    'Checks fname is a #! script.'
    with open(fname) as f:
        return f.read(2).startswith('#!')
Checks fname is a #! script.
def hasSheBang(fname):
    
    with open(fname) as f:
        return f.read(2).startswith('#!')