Skip to content

Display your traceback in a tkinter window. And you can view variables in each frame through tkinter.ttk.Treeview widget.

Notifications You must be signed in to change notification settings

KevinLi-py/traceback-gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

traceback-gui

Display your traceback in a tkinter window. And you can view variables in each frame through tkinter.ttk.Treeview widget.


Usage

import traceback_gui
traceback_gui.set_hook()
# Your code here.

Example: silly_add_1.py

Here is a example to show you how is traceback-gui.

Code:

import io
import sys

import traceback_gui

traceback_gui.set_hook()

# This program looks very silly. But it can show you how is traceback-gui.


def get_input(prompt):
    return input(prompt)


def add_1_with_input():
    first = get_input('A number: ')
    return first + 1


sys.stdin = io.StringIO('99\n')
try:
    print('Add 1 program')
    result = add_1_with_input()
    print(result)
except TypeError:
    print('Oh, there is an error!', error=TypeError)

Result:

A window popped up: image

Click the + button of the second treeview. You can see the value of variable first is a str. Then you can know why the exception happend: image

Click another tab. You can see the exception occorred during handling the above exception. image

About

Display your traceback in a tkinter window. And you can view variables in each frame through tkinter.ttk.Treeview widget.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages