MCPcopy Index your code
hub / github.com/ipython/ipython / get_ipython_cmd

Function get_ipython_cmd

IPython/testing/tools.py:144–160  ·  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: bool=False)

Source from the content-addressed store, hash-verified

142
143
144def get_ipython_cmd(as_string: bool=False) -> List[str]:
145 """
146 Return appropriate IPython command line name. By default, this will return
147 a list that can be used with subprocess.Popen, for example, but passing
148 `as_string=True` allows for returning the IPython command as a string.
149
150 Parameters
151 ----------
152 as_string: bool
153 Flag to allow to return the command as a string.
154 """
155 ipython_cmd = [sys.executable, "-m", "IPython"]
156
157 if as_string:
158 ipython_cmd = " ".join(ipython_cmd)
159
160 return ipython_cmd
161
162def ipexec(fname: str, options: Optional[List[str]]=None, commands: Tuple[str, ...]=()) -> Tuple[str, str]:
163 """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

Used in the wild real call sites across dependent graphs

searching dependent graphs…