Skip to content

Commit

Permalink
use os.environ dictionary to set environment variables (#2138)
Browse files Browse the repository at this point in the history
%export ENVIRONMENT_VARIABLE could led to "UsageError: Line magic function `%export` not found."

os.environ dictionary seems to be more generic and reuses the approach from other StreamPipes Python tutorials.
  • Loading branch information
obermeier authored Nov 5, 2023
1 parent ab609ff commit 55a0d0e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@
"execution_count": null,
"outputs": [],
"source": [
"%export SP_USERNAME=\"<USERNAME>\"\n",
"%export SP_API_KEY=\"<API-KEY>\""
"import os\n",
"os.environ[\"SP_USERNAME\"] = \"[email protected]\"\n",
"os.environ[\"SP_API_KEY\"] = \"XXX\"\n"
],
"metadata": {
"collapsed": false
Expand Down

0 comments on commit 55a0d0e

Please sign in to comment.