Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find API documentation for tkinter?

Tags:

python

tkinter

I am looking for a complete online reference for Python's tkinter module. I've tried to find one by myself, but for some reason I can't.

To clarify, I am not looking for a tutorial. Instead, I would like to have a reference for all the available classes and attributes.

For example, if I write this code:

from tkinter import *
root = Tk()
root.title("My title")

I wonder: what optional arguments does the Tk class accept for instantiation? What are properties and methods for a Tk object? What arguments does title accept? And so on...

"Look at the source" is not an answer to this question, obviously.

like image 599
kynikos Avatar asked Sep 02 '25 04:09

kynikos


2 Answers

For a definitive guide to all of the options supported by each widget you should consult the tcl/tk documentation. It's a fairly trivial mental exercise to translate the tcl into python. The only real problems are when the tcl options conflict with python reserved words (such as the -in option for pack and grid)

like image 115
Bryan Oakley Avatar answered Sep 04 '25 18:09

Bryan Oakley


There were 2 books that were very useful to me:

  • Mark Roseman's Modern Tkinter for Busy Python Programmers

  • John Grayson's Python and Tkinter Programming.

They are very complete. They might be hard to find online.

like image 30
Andrés Peña Castillo Avatar answered Sep 04 '25 19:09

Andrés Peña Castillo