Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PowerShell中的IPython Shell命令_Powershell_Ipython - Fatal编程技术网

PowerShell中的IPython Shell命令

PowerShell中的IPython Shell命令,powershell,ipython,Powershell,Ipython,我想使用IPython的shell命令特性使用Windows PowerShell命令,但许多命令似乎不起作用。具体地说,当我从PowerShell启动IPython时,我希望使用通常的PowerShell命令,使用对它们进行转义就像我在bash中做的那样。但是,例如,!cat,!ni,!rm和!cpall返回错误 '<command>' is not recognized as an internal or external command operable program or

我想使用IPython的shell命令特性
使用Windows PowerShell命令,但许多命令似乎不起作用。具体地说,当我从PowerShell启动IPython时,我希望使用通常的PowerShell命令,使用
对它们进行转义就像我在bash中做的那样。但是,例如,
!cat
!ni
!rm
!cp
all返回错误

'<command>' is not recognized as an internal or external command
operable program or batch file.
“”未被识别为内部或外部命令
可操作的程序或批处理文件。

为什么这些在PowerShell中不起作用,我如何修复它?

IPython“!”语法显然调用CMD.EXE,而不是PowerShell。您需要显式调用Powershell,可能是
!powershell-command{}
,但是如果IPython没有对其进行记录,那么包括任何必需的引号在内的确切语法将需要反复试验。有关更多信息,请参阅。

是否有方法切换
PowerShell的语法?另外,如果
调用CMD,您知道为什么在MinGW中从bash运行IPython时命令会起作用吗?IPython不知怎的知道如何切换到bash命令吗?@bcf——更准确地说,“!”语法显然调用了环境的默认shell——对于没有模拟的Windows,这将是CMD;对于Linux或Linux仿真,它将是默认的shell,通常是bash。我不使用IPython,因此您需要检查文档,以查看!可以改变。