Python交互式编程
交互式编程不需要创建脚本文件,是通过 Python 解释器的交互模式进来编写代码。
- linux上你只需要在命令行中输入 Python 命令即可启动交互式编程
- Windows上在安装Python时已经安装了默认的交互式编程客户端
#!/usr/bin/python
# -*- coding: UTF-8 -*-
print('中文编码')
安装配置列表
python 3.5.2,
ipython 5.1.0,
jupyter notebook,
matplotlib
安装python3.5
具体安装请参考官方文档。安装程序时注意勾选配置环境变量。
https://www.python.org/downloads/windows/
升级pip
python -m pip install --upgrade pip
使用pip安装ipython
pip.exe install ipython
交互模式效果
D:\tools>ipython
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' fo