Skip to content
/ tklog Public

Log widget based on tkinter, GUI tee (tkee) command

License

Notifications You must be signed in to change notification settings

xinlin-z/tklog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log is just like a cup of coffee, and I like it anytime! :)

tklog

tklog: a thread-safe log widget based on tkinter (inherited from ScrolledText).

It can be packed into root or Toplevel window easily, and has a little power to log pictures (png and gif).

The log interfaces all have an argument named sync from V0.12, default is False. You should be very careful about this argument, you can never use it in GUI event loop. Normally, sync=True should only be set in background thread which needs synchronization. For example, you want to make sure the log interface would be blocked until after the log info is shown on text window.

winlog

winlog: a toplevel log window based on tklog, which creats a Toplevel window, contains a tklog widget, and has the ability to withdraw or destroy root.

sample test code

Read the sample test code, and you'll learn how to use tklog and winlog. And you can also run the sample test code:

$ python test_tklog.py tklog
$ python test_tklog.py winlog

Don't forget to try right click on the logging area. Maybe there's a surprise for you.

Below is a screenshot for winlog:

winlog.png

tkee

It's a GUI tee! Tee store output into a file, tkee show them in winlog! Try it:

$ cat tklog.py | python tkee.py
$ ping bing.com | python tkee.py

Have fun! ^____^