Python Eval

Configuring the Python Evaluation Module

The Python Evaluation module allows users to evaluate Python code using an online Python interpreter and return the result.

Commands and Usage

  • Evaluate Python Code
    • Evaluates the provided Python code and returns the result.
    • Usage:
      • ,py <code>
      • ,python <code>
    • Example:
      • ,py print("Hello, world!")
      • ,python 5 + 3

Examples

  • To evaluate a Python code snippet:
    • ,py print("Hello, world!")
      • Response:
        • username: Hello, world!
  • To evaluate a Python arithmetic operation:
    • ,python 5 + 3
      • Response:
        • username: 8

Notes

  • The module sends the Python code to the online Python interpreter at http://dotpy3.herokuapp.com/ for evaluation.
  • If the request times out or fails, an appropriate error message is displayed.
  • The evaluated result is retrieved from the returned page data and sent back to the user.