Ipython magic for windows PowerShell
powershellmagic的Python项目详细描述
powershellmagic是一个ipython扩展,仿照ipython的 %%script magic,它支持在 Windows Powershell。
安装
作为python包:
$ pip install powershellmagic
作为ipython扩展:
In [1]: %install_ext https://raw.github.com/etgalloway/powershellmagic/master/powershellmagic.py
使用
In [1]: %load_ext powershellmagic In [2]: %%powershell ...: Get-WMiObject -Class Win32_Process | ...: Where-Object { $_.Name -like "*python.exe" } | ...: Select-Object ProcessName, ProcessID, ParentProcessId | ...: Format-Table -AutoSize ...: ProcessName ProcessID ParentProcessId ----------- --------- --------------- ipython.exe 5600 5616 python.exe 1740 5600