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

Function system

IPython/utils/_process_win32_controller.py:546–566  ·  view source on GitHub ↗

Win32 version of os.system() that works with network shares. Note that this implementation returns None, as meant for use in IPython. Parameters ---------- cmd : str A command to be executed in the system shell. Returns ------- None : we explicitly do NOT return

(cmd)

Source from the content-addressed store, hash-verified

544
545
546def system(cmd):
547 """Win32 version of os.system() that works with network shares.
548
549 Note that this implementation returns None, as meant for use in IPython.
550
551 Parameters
552 ----------
553 cmd : str
554 A command to be executed in the system shell.
555
556 Returns
557 -------
558 None : we explicitly do NOT return the subprocess status code, as this
559 utility is meant to be used extensively in IPython, where any return value
560 would trigger :func:`sys.displayhook` calls.
561 """
562 with AvoidUNCPath() as path:
563 if path is not None:
564 cmd = '"pushd %s &&"%s' % (path, cmd)
565 with Win32ShellCommandController(cmd) as scc:
566 scc.run()
567
568
569if __name__ == "__main__":

Callers 1

Calls 3

AvoidUNCPathClass · 0.70
runMethod · 0.45

Tested by

no test coverage detected