An example of how to use Python decorators for Botball.
Further reading can be found at https://realpython.com/primer-on-python-decorators/.
Note: The code on this repository contains modified versions of the examples from this link, tailored for use in teaching Botball students.
The code is broken up as follows:
functionargumentexample.py
: A standalone module showing how functions can be passed in as arguments to other functions. This functionality is not available in Java nor C, as far as I am aware.decorators.py
: Examples of actual decorators, and explanations of how they are used.main.py
: Calls the decorators defined indecorators.py
.expected_output_(module name).txt
: The output of the given module.
If you have any questions, please do not hesitate to email me at [email protected]. I will try to respond as quickly as I can.