Skip to content

System commands are for UNIX machines, recommend supplemental file that describes how to make them work on Windows #33

@cooknl

Description

@cooknl

UNIX system commands that show up in scientific-python-lectures and their Windows equivalents

PREFACE:
The Windows "cmd" window is of limited utility. Powershell is a windows shell utility with a greater scripting language. To use Powershell from python as a magic, you can download and use powershellmagic

https://pypi.python.org/pypi/powershellmagic/0.1.0

Install as a Python package:

$ pip install powershellmagic

Use in IPython Notebooks

In [1]: %load_ext powershellmagic


UNIX
;
WINDOWS


cat scripts/hello-world.py
;
!type scripts/hello-world.py #for cmd window

or

%%powershell
get-content scripts/hello-world.py


!head stockholm_td_adj.dat #There is no cmd window equivalent, !type will print the entire file
;
%%powershell
gc stockholm_td_adj.dat -TotalCount 3


!file random-matrix.npy
;
!assoc random-matrix.npy #Not really equivalent to !file


!rm -f dprod.pyf
;
%% powershell
!rm -f dprod.pyf


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions