We've built a console application that demonstrates how LaunchDarkly's SDK works.
Below, you'll find the basic build procedure. For more comprehensive instructions, you can visit your Quickstart page or the Python SDK reference guide.
This demo requires Python version 3.7 or higher.
-
Install the LaunchDarkly Python SDK by running
pip install -r requirements.txt -
On the command line, set the value of the environment variable
LAUNCHDARKLY_SERVER_KEYto your LaunchDarkly SDK key.export LAUNCHDARKLY_SERVER_KEY="1234567890abcdef"
-
On the command line, set the value of the environment variable
LAUNCHDARKLY_FLAG_KEYto an existing boolean feature flag in your LaunchDarkly project that you want to evaluate.export LAUNCHDARKLY_FLAG_KEY="my-boolean-flag"
-
Run
python test.py.
You should receive the message "Feature flag '<flag key>' is <true/false> for this context".