TinyTinyDebugger


NameTinyTinyDebugger JSON
Version 0.14 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/TinyTinyDebugger
SummarySimple debugger for small scripts, shows the line being executed, local vars ...
upload_time2023-01-22 05:30:19
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords debugger debugging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# TinyTinyDebugger

Simple debugger for small scripts - shows the line being executed, local vars ...
It only can be used if your script is in a .py file. It doesn't work directly from the console.
```python
pip install TinyTinyDebugger
```

```python
#Examples
from TinyTinyDebugger import (
function_debug,
detailed_debugger
)

@function_debug(
sleep_between_each_line=1)
def combinations(iterable, r):
    pool = tuple(iterable)
    n = len(pool)
    if r > n:
        print('r bigger n')
    indices = list(range(r))
    # provoking an Exception
    wrong = indices / 0
    return indices
#combinations("ABCD", 2)
from pprint import pprint



@function_debug(
    active=True,  # used to disable the debugger
    write_log_file=False,  # if True, data will be saved to hdd. Import allow_long_path_windows from windows_filepath and execute before! function_debug won't check for path length, so it is better to allow long file names
    log_folder='c:\\debugmyfunction',  # default value is the folder "_tinytinydebugger_log" in cwd
    pause_for_n_seconds_when_except=10,  # Only important if continue_on_exceptions is True. The execution will be paused and you can read the Exception. When you are done, press ctrl+c to continue
    continue_on_exceptions=True,  # if True, the execution will go on
    capture_local_vars=True,  # If True, all local variables in the function will be saved after each line in: detailed_debugger.local_function_vars
    color_print=True,  # black/white or colored
    print_line=True,  # If False, the event "line" won't be printed
    print_return=True,  # If False, the event "return" won't be printed
    print_exception=True,  # If False, the event "exception" won't be printed
    print_execution_time=True,  # enable/disable printing of execution time
    print_local_vars=True,  # if True: prints all local variables in the function each line
    sleep_between_each_line=0,  # sleep after each line of code
)
def baba(x):
    print(4/x)

baba(10)
pprint(detailed_debugger
       .local_function_vars)


```

Take a look at the video:
[![YT](https://github.com/hansalemaos/screenshots/raw/main/errorcode.png)](https://www.youtube.com/shorts/Jk-ZhFeJJ-A)
[https://www.youtube.com/shorts/Jk-ZhFeJJ-A]()

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/TinyTinyDebugger",
    "name": "TinyTinyDebugger",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "debugger,debugging",
    "author": "Johannes Fischer",
    "author_email": "<aulasparticularesdealemaosp@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/09/7e/fbffcb7217ff199421f189d0fcb99c75c5f875da50924ed50d93c91d8706/TinyTinyDebugger-0.14.tar.gz",
    "platform": null,
    "description": "\n# TinyTinyDebugger\n\nSimple debugger for small scripts - shows the line being executed, local vars ...\nIt only can be used if your script is in a .py file. It doesn't work directly from the console.\n```python\npip install TinyTinyDebugger\n```\n\n```python\n#Examples\nfrom TinyTinyDebugger import (\nfunction_debug,\ndetailed_debugger\n)\n\n@function_debug(\nsleep_between_each_line=1)\ndef combinations(iterable, r):\n    pool = tuple(iterable)\n    n = len(pool)\n    if r > n:\n        print('r bigger n')\n    indices = list(range(r))\n    # provoking an Exception\n    wrong = indices / 0\n    return indices\n#combinations(\"ABCD\", 2)\nfrom pprint import pprint\n\n\n\n@function_debug(\n    active=True,  # used to disable the debugger\n    write_log_file=False,  # if True, data will be saved to hdd. Import allow_long_path_windows from windows_filepath and execute before! function_debug won't check for path length, so it is better to allow long file names\n    log_folder='c:\\\\debugmyfunction',  # default value is the folder \"_tinytinydebugger_log\" in cwd\n    pause_for_n_seconds_when_except=10,  # Only important if continue_on_exceptions is True. The execution will be paused and you can read the Exception. When you are done, press ctrl+c to continue\n    continue_on_exceptions=True,  # if True, the execution will go on\n    capture_local_vars=True,  # If True, all local variables in the function will be saved after each line in: detailed_debugger.local_function_vars\n    color_print=True,  # black/white or colored\n    print_line=True,  # If False, the event \"line\" won't be printed\n    print_return=True,  # If False, the event \"return\" won't be printed\n    print_exception=True,  # If False, the event \"exception\" won't be printed\n    print_execution_time=True,  # enable/disable printing of execution time\n    print_local_vars=True,  # if True: prints all local variables in the function each line\n    sleep_between_each_line=0,  # sleep after each line of code\n)\ndef baba(x):\n    print(4/x)\n\nbaba(10)\npprint(detailed_debugger\n       .local_function_vars)\n\n\n```\n\nTake a look at the video:\n[![YT](https://github.com/hansalemaos/screenshots/raw/main/errorcode.png)](https://www.youtube.com/shorts/Jk-ZhFeJJ-A)\n[https://www.youtube.com/shorts/Jk-ZhFeJJ-A]()\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simple debugger for small scripts, shows the line being executed, local vars ...",
    "version": "0.14",
    "split_keywords": [
        "debugger",
        "debugging"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23b7d8d1a11c7732022d8c6cad7a1c96134b7c6bbebd0754d62b4dcb8127140c",
                "md5": "dd4b08226c68995ce7691657f48060af",
                "sha256": "ec0952dfcd0b6cfc9a04aba4144a3a292ebee5d4d6b32abc000583b6568fc2a6"
            },
            "downloads": -1,
            "filename": "TinyTinyDebugger-0.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dd4b08226c68995ce7691657f48060af",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8709,
            "upload_time": "2023-01-22T05:30:17",
            "upload_time_iso_8601": "2023-01-22T05:30:17.439169Z",
            "url": "https://files.pythonhosted.org/packages/23/b7/d8d1a11c7732022d8c6cad7a1c96134b7c6bbebd0754d62b4dcb8127140c/TinyTinyDebugger-0.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "097efbffcb7217ff199421f189d0fcb99c75c5f875da50924ed50d93c91d8706",
                "md5": "df0e8a2c6332d51b17b70369c8b9cb41",
                "sha256": "7294fb55cf24b3b4c20110bf077fcec448bf4a86b4d9405387813c999c2dccd0"
            },
            "downloads": -1,
            "filename": "TinyTinyDebugger-0.14.tar.gz",
            "has_sig": false,
            "md5_digest": "df0e8a2c6332d51b17b70369c8b9cb41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6843,
            "upload_time": "2023-01-22T05:30:19",
            "upload_time_iso_8601": "2023-01-22T05:30:19.073368Z",
            "url": "https://files.pythonhosted.org/packages/09/7e/fbffcb7217ff199421f189d0fcb99c75c5f875da50924ed50d93c91d8706/TinyTinyDebugger-0.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-22 05:30:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "hansalemaos",
    "github_project": "TinyTinyDebugger",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "tinytinydebugger"
}
        
Elapsed time: 0.03102s