11 ...
* error 錯誤 * name 名字 * defined 已經定義 * syntax 語法 * invalid 無效 * Indentation 索引 * unexpected 意外的,不期望的 * character 字元 * line 行 * encoding 編碼 * declared 聲明 * details 細節,詳細信息 * ASCII 一種字元編碼
Python 的解釋器 如今有多個語言的實現,包括: - CPython —— 官方版本的 C 語言實現 - Jython —— 可以運行在 Java 平臺 - IronPython —— 可以運行在 .NET 和 Mono 平臺 - PyPy —— Python 實現的,支持 JIT 即時編譯
http://ipython.org/install.html
-
-
Python 3.x 使用的解釋器是 ipython3
import sys for path in sys.path: print(path)
結果:
/home/abc/PycharmProjects/study/venv/bin/python /home/abc/PycharmProjects/study/demo.py
/home/abc/PycharmProjects/study
/home/abc/PycharmProjects/study
/usr/lib/python35.zip
/usr/lib/python3.5
/usr/lib/python3.5/plat-x86_64-linux-gnu
/usr/lib/python3.5/lib-dynload
/home/abc/PycharmProjects/study/venv/lib/python3.5/site-packages
/home/abc/PycharmProjects/study/venv/lib/python3.5/site-packages/setuptools-39.1.0-py3.5.egg
/opt/pycharm-2018.3.3/helpers/pycharm_matplotlib_backend
Process finished with exit code 0
$ pip --version pip 19.0.3 from /home/abc/PycharmProjects/study/venv/lib/python3.5/site-packages/pip (python 3.5)
$ pip install ipython
Python一鍵安裝全部依賴包
$ pip install requests
$ pip freeze > requirements.txt
certifi==2018.11.29
chardet==3.0.4
idna==2.8
requests==2.21.0
urllib3==1.24.1
$ pip install -r requirements.txt