K0nkere / DL_Dice-detection-project

DnD dice detection with CNN and transfer learning / Project for ML Bookcamp
0 stars 0 forks source link

How to: environmental variables for Linux env #13

Open K0nkere opened 1 year ago

K0nkere commented 1 year ago

Exporting few env vars

Create file env.sh

#!/usr/bin/env bash
export PG_USER=<user>
export PG_PASS=<pass>
chmod +x env.sh

run with

bash env.sh
# or
. env.sh
K0nkere commented 1 year ago

Setting enviromental variables out of Jupyter Notebook

import os

%env PG_USER=root
%env PG_PASS=root

user = os.getenv("PG_USER","")
pw = os.getenv("PG_PASS", "")