Show More
@@ -1,30 +1,31 b'' | |||
|
1 | 1 | |
|
2 | 2 | import os,sys |
|
3 | 3 | |
|
4 | 4 | def selflaunch(line): |
|
5 | 5 | """ Launch python script with 'this' interpreter |
|
6 | 6 | |
|
7 | 7 | e.g. d:\foo\ipython.exe a.py |
|
8 | 8 | |
|
9 | 9 | """ |
|
10 | 10 | cmd = sys.executable + ' ' + line.split(None,1)[1] |
|
11 | 11 | print ">",cmd |
|
12 | 12 | os.system(cmd) |
|
13 | 13 | |
|
14 | 14 | def main(): |
|
15 | 15 | import IPython.ipapi |
|
16 | 16 | ip = IPython.ipapi.get() |
|
17 | 17 | |
|
18 | 18 | root = os.environ.get('IPYKITROOT', None) |
|
19 | 19 | if not root: |
|
20 | 20 | print "Can't configure ipykit, IPYKITROOT should be set." |
|
21 | 21 | return |
|
22 | 22 | |
|
23 | 23 | os.environ["PATH"] = os.environ["PATH"] + ";" + root + "\\bin;" |
|
24 | 24 | |
|
25 | 25 | ip.defalias('py',selflaunch) |
|
26 | 26 | |
|
27 | ip.defalias('ls','ls -F') | |
|
27 | 28 | |
|
28 | 29 | main() |
|
29 | 30 | |
|
30 | 31 |
General Comments 0
You need to be logged in to leave comments.
Login now