shell 下python/PySpark 代码高亮和 自动提示 代码补全
1. 用法
1. pip install "ptpython==0.41"
#默认最新版本 ptpython-2.0.4 有bug, 自动提示不起作用。0.41的没问题
#pip版本(pip --version),决定你装的库基于python2 还是3.
2. export PYSPARK_DRIVER_PYTHON=ptpython;
2. ptpython效果
对spark 项目,到Home目录下 运行 /bin/pyspark
3. ptpython 自定义配置保存
每次关了session 以后,自己ptpython的设置会丢失。
Copy 下面的config.py(在config.py设置你的初始配置) 到 ~/.ptpython/config.py
https://github.com/prompt-toolkit/ptpython/blob/master/examples/ptpython_config/config.py