MCPcopy Create free account
hub / github.com/ipython/ipython / get_ipython_cmd

Function get_ipython_cmd

IPython/testing/tools.py:151–167  ·  view source on GitHub ↗

Return appropriate IPython command line name. By default, this will return a list that can be used with subprocess.Popen, for example, but passing `as_string=True` allows for returning the IPython command as a string. Parameters ---------- as_string: bool Flag to al

(as_string=False)

Source from the content-addressed store, hash-verified

149
150
151def get_ipython_cmd(as_string=False):
152 """
153 Return appropriate IPython command line name. By default, this will return
154 a list that can be used with subprocess.Popen, for example, but passing
155 `as_string=True` allows for returning the IPython command as a string.
156
157 Parameters
158 ----------
159 as_string: bool
160 Flag to allow to return the command as a string.
161 """
162 ipython_cmd = [sys.executable, "-m", "IPython"]
163
164 if as_string:
165 ipython_cmd = " ".join(ipython_cmd)
166
167 return ipython_cmd
168
169def ipexec(fname, options=None, commands=()):
170 """Utility to call 'ipython filename'.

Callers 3

ipexecFunction · 0.85
help_output_testFunction · 0.85
help_all_output_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected