##// END OF EJS Templates
Add option for specifying Python executable to 'launch_kernel'.
epatters -
Show More
@@ -155,7 +155,7 b' def make_default_main(kernel_factory):'
155 155
156 156
157 157 def base_launch_kernel(code, xrep_port=0, pub_port=0, req_port=0, hb_port=0,
158 independent=False, extra_arguments=[]):
158 executable=None, independent=False, extra_arguments=[]):
159 159 """ Launches a localhost kernel, binding to the specified ports.
160 160
161 161 Parameters
@@ -175,6 +175,9 b' def base_launch_kernel(code, xrep_port=0, pub_port=0, req_port=0, hb_port=0,'
175 175 hb_port : int, optional
176 176 The port to use for the hearbeat REP channel.
177 177
178 executable : str, optional (default sys.executable)
179 The Python executable to use for the kernel process.
180
178 181 independent : bool, optional (default False)
179 182 If set, the kernel process is guaranteed to survive if this process
180 183 dies. If not set, an effort is made to ensure that the kernel is killed
@@ -212,7 +215,9 b' def base_launch_kernel(code, xrep_port=0, pub_port=0, req_port=0, hb_port=0,'
212 215 hb_port = ports.pop(0)
213 216
214 217 # Build the kernel launch command.
215 arguments = [ sys.executable, '-c', code, '--xrep', str(xrep_port),
218 if executable is None:
219 executable = sys.executable
220 arguments = [ executable, '-c', code, '--xrep', str(xrep_port),
216 221 '--pub', str(pub_port), '--req', str(req_port),
217 222 '--hb', str(hb_port) ]
218 223 arguments.extend(extra_arguments)
@@ -551,7 +551,7 b' class GTKKernel(Kernel):'
551 551 #-----------------------------------------------------------------------------
552 552
553 553 def launch_kernel(ip=None, xrep_port=0, pub_port=0, req_port=0, hb_port=0,
554 independent=False, pylab=False, colors=None):
554 executable=None, independent=False, pylab=False, colors=None):
555 555 """Launches a localhost kernel, binding to the specified ports.
556 556
557 557 Parameters
@@ -571,6 +571,9 b' def launch_kernel(ip=None, xrep_port=0, pub_port=0, req_port=0, hb_port=0,'
571 571 hb_port : int, optional
572 572 The port to use for the hearbeat REP channel.
573 573
574 executable : str, optional (default sys.executable)
575 The Python executable to use for the kernel process.
576
574 577 independent : bool, optional (default False)
575 578 If set, the kernel process is guaranteed to survive if this process
576 579 dies. If not set, an effort is made to ensure that the kernel is killed
@@ -605,7 +608,7 b' def launch_kernel(ip=None, xrep_port=0, pub_port=0, req_port=0, hb_port=0,'
605 608 extra_arguments.append(colors)
606 609 return base_launch_kernel('from IPython.zmq.ipkernel import main; main()',
607 610 xrep_port, pub_port, req_port, hb_port,
608 independent, extra_arguments)
611 executable, independent, extra_arguments)
609 612
610 613
611 614 def main():
@@ -248,7 +248,7 b' class Kernel(HasTraits):'
248 248 #-----------------------------------------------------------------------------
249 249
250 250 def launch_kernel(ip=None, xrep_port=0, pub_port=0, req_port=0, hb_port=0,
251 independent=False):
251 executable=None, independent=False):
252 252 """ Launches a localhost kernel, binding to the specified ports.
253 253
254 254 Parameters
@@ -268,6 +268,9 b' def launch_kernel(ip=None, xrep_port=0, pub_port=0, req_port=0, hb_port=0,'
268 268 hb_port : int, optional
269 269 The port to use for the hearbeat REP channel.
270 270
271 executable : str, optional (default sys.executable)
272 The Python executable to use for the kernel process.
273
271 274 independent : bool, optional (default False)
272 275 If set, the kernel process is guaranteed to survive if this process
273 276 dies. If not set, an effort is made to ensure that the kernel is killed
@@ -288,7 +291,8 b' def launch_kernel(ip=None, xrep_port=0, pub_port=0, req_port=0, hb_port=0,'
288 291
289 292 return base_launch_kernel('from IPython.zmq.pykernel import main; main()',
290 293 xrep_port, pub_port, req_port, hb_port,
291 independent, extra_arguments=extra_arguments)
294 executable, independent,
295 extra_arguments=extra_arguments)
292 296
293 297 main = make_default_main(Kernel)
294 298
General Comments 0
You need to be logged in to leave comments. Login now