问题
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.
回答1:
Found it here on GitHub for cpython
回答2:
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".
来源:https://stackoverflow.com/questions/44798254/where-can-i-find-the-source-code-for-the-tkinter-module