简体   繁体   中英

How do I add %cat to IPython?

I just started using IPython and learning from the tutorials. I have created a file but when I use the %cat command I get ERROR: Line magic function %cat not found. When I type %alias it does not list 'cat' as one of the commands. How can I add it to the list?

For command line in ipython, use ! instead of %

!ls
!pwd
!cat
...

%alias cat cat , this makes %cat just like typing !cat . Really only useful if you have standard flags or arguments or more complex commands, eg one of the standard aliases: list files with execute bit set alias lx ls -F -l -G %l | grep ^-..x alias lx ls -F -l -G %l | grep ^-..x

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM