Skip to content

An example of how to use Python decorators, intended as an aid in teaching Botball students.

Notifications You must be signed in to change notification settings

dotcomstar/DecoratorsExample

Repository files navigation

DecoratorsExample

Botball Concept Difficulty: Advanced

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.

📁 Code Structure

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 in decorators.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 gamestar109@live.com. I will try to respond as quickly as I can.

About

An example of how to use Python decorators, intended as an aid in teaching Botball students.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages