ReveekJ / DEBUG

Simple debuging pack for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DEBUG

Simple debug on Python

Dependencies

Python 3.x required. All libraries used in the code are built into Python

How to use

variable DEBUG

The debug variable can take the values ​​True or False

Example

from DEBUG.DEBUG import DEBUG

try:
    ...
except Exception as e:
    if DEBUG:
        print(e)

decorator _timer

A decorator that measures the duration of a program and returns it

Example

from DEBUG.DEBUG import _timer
# time is built-in function
import time


@_timer
def test():
    time.sleep(5)


f = test
print(f())
# output: 0:00:05.004447

About

Simple debuging pack for Python


Languages

Language:Python 100.0%