yinian 发表于 2018-8-12 06:05:14

Python学习笔记—第二章—IPython

# alias用法:  
In : alias nss netstat -antupl
  
# 别名alias的2种输入方式
  
# do-nothing方式:传递给命令的所有附加参数都能够组织在一起
  
In : nss | grep 80
  
# do-everything方式:采用隐含参数传递的方式,需要显示地操作所有后续参数
  
In : alias achoo echo first:"|%s|",second:"|%s|"
  
In : achoo foo bar
  
first:|foo|,second:|bar|
  
# 保存使用的别名,使得下一次打开IPython时,能够继续使用此别名
  
In : store achoo
  
Alias stored: achoo (echo first:"|%s|",second:"|%s|")
页: [1]
查看完整版本: Python学习笔记—第二章—IPython