3

我试图隐藏我的登录凭据,在我的 .bash_profile 中创建我的变量。export var = 'foo'并在 jupyter notebook 中使用os.environ.get('var'). 结果是无。

在我的普通 IDE 中,这很容易,因为我的步骤是:

> cd
> nano .bash_profile
> export var = 'foo'

设置.py

os.environ.get('var')

output: foo

从这里,我的 IDE 访问该特定的 bash 配置文件并返回我请求的内容。

如何访问 jupyter notebook bash 配置文件并在其中创建变量?谢谢。

4

0 回答 0