pymg is a CLI tool that can interpret Python files by the Python interpreter and display the error message in a more readable way if an exception occurs.
Project description
Introduction
pymg is a CLI tool that can interpret Python files by the Python interpreter and display the error message in a more readable way if an exception occurs.
You can read the following documents to learn more about pymg:
pymg is a free and open source project. Any contribution is welcome. You can do this by registering a pull request.
Installation
You can use pip to install:
python3 -m pip install pymg
Example:
Let's check the test.py file as an example:
import sys
def div(a, b):
return a / b
print(div(int(sys.argv[1]), int(sys.argv[2])))
The task of this program is very simple. It passes the two values it receives from the command line arguments to the div function, and the div function divides them.
Now let interpret the test.py file with pymg so that the ZeroDivisionError exception occurs:
$ pymg test.py 4 0
Output:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.