1.2 IPython安装与使用

4/12/2018 Python

# IPython安装与使用

# 安装 Ipython

image-20191220204758389

# 创建IPython 软连接

ln -s /usr/local/python3/bin/ipython3 /usr/bin/ipython3
1

# 启动和退出 Ipython

image-20191220204908038

# 基本使用

  1. 支持更友好的命令提示

image-20191220205547817

image-20191220205641091

  1. 执行 shell 命令
[root@VM_0_7_centos ~]# ipython3
Python 3.7.0 (default, Oct 27 2019, 00:36:26)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.10.2 -- An enhanced Interactive Python. Type '?' for help.

In [1]: !pwd
/root

In [2]: pwd
Out[2]: '/root'

In [3]: cd /tmp  # cd 不需要!号
/tmp

In [4]: pwd
Out[4]: '/tmp'

In [5]: !cd /root/

In [6]:

In [6]: pwd
Out[6]: '/tmp'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  1. 运行 python 脚本

image-20191220210042952

image-20191220210119129