ipython.py
24 lines
| 848 B
| text/x-python
|
PythonLexer
vivainio
|
r103 | #!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||||
"""IPython -- An enhanced Interactive Python | ||||
The actual ipython script to be installed with 'python setup.py install' is | ||||
Aaron Meurer
|
r9320 | generated by setuptool via the `console_scripts` mechanism. This file is here | ||
Aaron Meurer
|
r9319 | (ipython source root directory) to facilitate non-root 'zero-installation' | ||
(just copy the source tree somewhere and run ipython.py) and development. | ||||
""" | ||||
vivainio
|
r103 | |||
Stefan van der Walt
|
r4562 | if __name__ != "__main__": | ||
raise RuntimeError('You are trying to import the ipython.py executable. ' | ||||
'Did you mean to call "import IPython" (case-sensitive) instead?') | ||||
Fernando Perez
|
r2481 | # Ensure that the imported IPython is the local one, not a system-wide one | ||
import os, sys | ||||
Thomas Spura
|
r3265 | this_dir = os.path.dirname(sys.argv[0]) | ||
Fernando Perez
|
r2481 | sys.path.insert(0, this_dir) | ||
Brian Granger
|
r2280 | |||
Fernando Perez
|
r2481 | # Now proceed with execution | ||
Brian Granger
|
r2760 | execfile(os.path.join( | ||
Fernando Perez
|
r3072 | this_dir, 'IPython', 'scripts', 'ipython' | ||
Brian Granger
|
r2760 | )) | ||