Codebug replaces scary error messages with digestible text-explanations of the error.
When pandas encounters an error, it spits out a massive red text.
- Hard to discern the error message
- Bold red text discourages coding beginners
Codebug takes in the error message and returns a simple explanation of it.
- Encourages student to understand the error
- Clears up python misconceptions
- Offers practical suggestions to fix buggy code
Codebug is powered by GPT-3.5 from OpenAI.
Add this line to your command line:
pip install Codebugger
If encounter ModuleNotFoundError:
Run following code in python file:
import sys
print(sys.executable)
Copy the path (i.e. it may look like this):
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
Install codebugger using the following path in the terminal:
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install Codebugger
Add the following to your python file:
from codebugger import Codebug
Create new instance of Codebug() class:
debug = Codebug()
Print Error Message:
debug.getMessage()
When no errors are encountered, Codebug returns: "No errors found!"
To recieve explantions of error, user must get API Key from OpenAI: https://platform.openai.com/account/api-keys
Set API-KEY
debug.setAPI('API-KEY')
Requires basic understanding of try/except.
Try and Except:
try:
block of code
except Exception as e:
debug.setError() # Compiles the error
print(debug.explnation()) #API Call to GPT-3.5 for explnation of error