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

可紊 提交于 2021-01-28 00:17:41

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!