1、python中查看历史命令的方法:%history 或 %hist 2、输出带有序号的历史命令:%history -n、%hist -n 3、模糊匹配历史命令:%history -g、%hist -g 4、查看history的使用帮助:%history?