ipy_kitcfg.py
30 lines
| 606 B
| text/x-python
|
PythonLexer
|
r704 | |||
|
r798 | import os,sys | ||
|
r704 | |||
|
r798 | def selflaunch(line): | ||
""" Launch python script with 'this' interpreter | ||||
e.g. d:\foo\ipython.exe a.py | ||||
""" | ||||
cmd = sys.executable + ' ' + line.split(None,1)[1] | ||||
print ">",cmd | ||||
os.system(cmd) | ||||
|
r704 | def main(): | ||
|
r798 | import IPython.ipapi | ||
ip = IPython.ipapi.get() | ||||
|
r704 | root = os.environ.get('IPYKITROOT', None) | ||
if not root: | ||||
print "Can't configure ipykit, IPYKITROOT should be set." | ||||
return | ||||
os.environ["PATH"] = os.environ["PATH"] + ";" + root + "\\bin;" | ||||
|
r798 | |||
ip.defalias('py',selflaunch) | ||||
|
r704 | |||
main() | ||||