Quickstart¶
This page gives you a brief introduction to the library. If you don’t have the library installed yet, check Installation first.
Minimal example¶
Let’s make our first use of the library.
First, create a file called main.py and add following code (explanation below):
from uncle_nelson import calculate_mix, DrugType, IngredientType
def main():
mix = calculate_mix(DrugType.meth, [IngredientType.cuke, IngredientType.banana])
effects = ", ".join(e.value for e in mix.effects)
print(f"Your custom mix has following effects: {effects}")
if __name__ == "__main__":
main()
It’s a really basic example, but let’s have a look what happens here:
First lines imports
calculate_mix(),DrugType, andIngredientTypeto calculate a mix.Inside the
mainfunction we callcalculate_mix()with theDrugTypeand a list ofIngredientType(Note: The order matters, because each ingredient is applied individually).After that we get all the information of the mix, including the effects, price and cost.
Finally we execute our
mainfunction.
Now let’s run the script.
On Linux/MacOS, use
python3 main.py
On Windows, use
py -3 main.py
This should output something like this
Your custom mix has following effects: Thought-Provoking, Gingeritis