Below, you'll find the basic build procedure, but for more comprehensive instructions, you can visit your Quickstart page or the Python SDK reference guide.
This demo requires Python version 3.5 or higher.
-
Install the LaunchDarkly Python SDK by running
pip install requirements.txt
-
Edit
test.py
and set the value ofsdk_key
to your LaunchDarkly SDK key. If there is an existing boolean feature flag in your LaunchDarkly project that you want to evaluate, setfeature_flag_key
to the flag key.
sdk_key = "1234567890abcdef"
feature_flag_key = "my-flag"
- Run
python test.py
.
You should see the message "Feature flag '<flag key>' is <true/false> for this user"
.