Håkon Hægland
Håkon Hægland

Reputation: 40748

Where can I find the source code for the _tkinter module?

According to the Python 3 documentation, Chapter 25.1: tkinter - Python interface to Tcl/Tk:

The Tk interface is located in a binary module named _tkinter. This module contains the low-level interface to Tk

Where can I obtain the source code of this module?

I checked python/cython on GitHub, but could not find it.

Upvotes: 6

Views: 11197

Answers (2)

Manu J4
Manu J4

Reputation: 2859

Check also this answer here which is related to your problem and gives this source (https://hg.python.org/cpython/file/3.6/) from python.org.

How did I get there? In python,

>>> import _tkinter
>>> _tkinter.__file__
'/usr/lib/python2.7/lib-dynload/_tkinter.so'

Then in Google: "Python lib-dynload source".

Upvotes: 4

Hugues M.
Hugues M.

Reputation: 20467

Found it here on GitHub for cpython

Upvotes: 5

Related Questions