def selflaunch(ip,line):
    """ Launch python script with 'this' interpreter
    
    e.g. d:\foo\ipykit.exe a.py
    
    """
    
    tup = line.split(None,1)
    if len(tup) == 1:
        print("Launching nested ipython session")
        os.system(sys.executable)
        return
        
    cmd = sys.executable + ' ' + tup[1]
    print(">",cmd)
    os.system(cmd)
dataset/ETHPy150Open ipython/ipython-py3k/IPython/quarantine/ipy_rehashdir.py/selflaunch/original