##// END OF EJS Templates
use `python -m IPython.kernel` in IPython kernelspec...
MinRK -
Show More
@@ -117,8 +117,7 b' class KernelSpecManager(HasTraits):'
117 The native kernel is the kernel using the same Python runtime as this
117 The native kernel is the kernel using the same Python runtime as this
118 process. This will put its informatino in the user kernels directory.
118 process. This will put its informatino in the user kernels directory.
119 """
119 """
120 return {'argv':make_ipkernel_cmd(
120 return {'argv': make_ipkernel_cmd(),
121 'from IPython.kernel.zmq.kernelapp import main; main()'),
122 'display_name': 'IPython (Python %d)' % (3 if PY3 else 2),
121 'display_name': 'IPython (Python %d)' % (3 if PY3 else 2),
123 'language': 'python',
122 'language': 'python',
124 'codemirror_mode': {'name': 'ipython',
123 'codemirror_mode': {'name': 'ipython',
@@ -78,13 +78,13 b' def swallow_argv(argv, aliases=None, flags=None):'
78 return stripped
78 return stripped
79
79
80
80
81 def make_ipkernel_cmd(code, executable=None, extra_arguments=[], **kw):
81 def make_ipkernel_cmd(mod='IPython.kernel', executable=None, extra_arguments=[], **kw):
82 """Build Popen command list for launching an IPython kernel.
82 """Build Popen command list for launching an IPython kernel.
83
83
84 Parameters
84 Parameters
85 ----------
85 ----------
86 code : str,
86 mod : str, optional (default 'IPython.kernel')
87 A string of Python code that imports and executes a kernel entry point.
87 A string of an IPython module whose __main__ starts an IPython kernel
88
88
89 executable : str, optional (default sys.executable)
89 executable : str, optional (default sys.executable)
90 The Python executable to use for the kernel process.
90 The Python executable to use for the kernel process.
@@ -99,7 +99,7 b' def make_ipkernel_cmd(code, executable=None, extra_arguments=[], **kw):'
99 """
99 """
100 if executable is None:
100 if executable is None:
101 executable = sys.executable
101 executable = sys.executable
102 arguments = [ executable, '-c', code, '-f', '{connection_file}' ]
102 arguments = [ executable, '-m', mod, '-f', '{connection_file}' ]
103 arguments.extend(extra_arguments)
103 arguments.extend(extra_arguments)
104
104
105 if sys.platform == 'win32':
105 if sys.platform == 'win32':
@@ -26,7 +26,6 b' from IPython.utils.traitlets import ('
26 Any, Instance, Unicode, List, Bool, Type, DottedObjectName
26 Any, Instance, Unicode, List, Bool, Type, DottedObjectName
27 )
27 )
28 from IPython.kernel import (
28 from IPython.kernel import (
29 make_ipkernel_cmd,
30 launch_kernel,
29 launch_kernel,
31 kernelspec,
30 kernelspec,
32 )
31 )
General Comments 0
You need to be logged in to leave comments. Login now