ipython / ipython/ipython

Wishlist: add a `--env` option to `%%script` to set environment variables

Open
#4,472 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
16.8k
Forks
4.5k
Avg merge
1d 2h
Merged PRs (30d)
6

Description

It would be nice to be able to set environment variables when invoking an external program/script. It can currently be done with command line games, eg: on most linux flavours you could do:

```
%%script env myScriptVar=someValue ruby
...
```

but it would seem more natural for the capability to be in `%%script`, not the least because it could be platform agnostic.

One potential approach would be to allow arbitrary `Popen` args (as a dict perhaps?).

ps: the `env` command also allows unsetting environment variables - another useful option, but perhaps less important..

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.