python - bpython配置——默认导入numpy和matplotlib

标签 python numpy bpython

是否可以启动 bpython解释器,以便它在启动时始终运行一些自定义命令?

就我而言,我只想做:

import numpy as np
import matplotlib.pyplot as plt

我在 docs 中看不到任何内容.有谁知道方法吗?

最佳答案

它写在文档中,只是没有在以下位置明确标记:http://docs.bpython-interpreter.org/django.html

要点是您可以拥有一个名为 PYTHONSTARTUP 的环境变量。 bpython 将在您进入解释器之前执行此文件。

关于python - bpython配置——默认导入numpy和matplotlib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9112071/

相关文章:

python - 将查询结果显示到 View 中

python - sqlite/python - 不带引号的命名参数?

python - python如何处理条件语句中的临时变量?

python-3.x - 如何在另一个 np.where 中使用 np.where (conext : ray tracing)

python - bpython -i & 命名空间

python - difflib 根据序列的顺序返回不同的比率

python - 使用 genfromtxt 创建具有空列的 numpy 数组

python - 带有 mask 和 RGB 图像的 Numpy/Scipy

python - Blender 2.5 Python 动画世界纹理设置

python - 具有 bpython 特性的 IPython