Skip to content

Add %ls for Windows compatibility #10582

@techtonik

Description

@techtonik

IPython line magics have almost everything needed for cross-platform scripting, except basic %ls command, relying on system !ls instead, which is absent on Windows.

In [4]: !ls
'ls' is not recognized as an internal or external command,
operable program or batch file.

Return list of directory contents:

%ls [PATTERN]

And protect from:

root@lx:~# ls *.rsh
ls: cannot access '*.rsh': No such file or directory

https://unix.stackexchange.com/questions/102286/ls-gives-no-such-file-or-directory-message

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions