Skip to main content

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

pypi license

img1

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:

How does pymg work

How to use 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: img1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymg-1.1.0.tar.gz (23.1 kB view hashes)

Uploaded Source

Built Distribution

pymg-1.1.0-py3-none-any.whl (23.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page