Useful tools for debugging Python code
Project description
lets-debug
Install
pip install lets-debug
Tools
You will find useful tools for debugging in Python with this package.
The main feature here is terminal
variable, an istance of _Terminal
class that allows you to print anything on terminal using different colors. Some methods of this class are similar to JavaScript Console
native class.
Another useful tool for debugging code is stopwatch
decorator method from DecoratorTools
class. It allows you to verify how much longer is the waiting time for any function.
from lets_debug import terminal, DecoratorTools as tools
@tools.stopwatch
def greeting():
terminal.count('Greeting function')
greeting()
The example code above will give you an output like this:
Greeting function: 1
Waiting time for greeting: 0.04291534423828125
Some ideas of this package come from other languages, like Java.
class Person:
def __init__(self, is_alive=True):
self.is_alive = is_alive
def code(self):
pass
class Programmer(Person):
def __init__(self, is_alive):
super().__init__(is_alive)
if self.is_alive:
self.code()
@tools.override(get_error=True) # If code() does not exist on Person class an Exception occurs
def code(self):
terminal.log('Keep coding :)')
Now, explore the tools of this package and feel free to colaborate with your best ideas!
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
Built Distribution
Hashes for lets_debug-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb88430529bfbc76f391f09d5f75d2f062a80ed8f1e70e43f8df0d2c8c777b78 |
|
MD5 | 5b98196b91f376da86f84f37e387282f |
|
BLAKE2b-256 | f4ba604e1b3c0253f821f901c5597637e88642d215207cdb9105815736302bf7 |