How to find the path of Tcl/Tk library that Tkinter is currently using?

后端 未结 1 909
刺人心
刺人心 2021-01-19 19:10

TCL_LIBRARY and TK_LIBRARY environment variables can be used to bind Tkinter with proper Tcl/Tk installation.

How to get the location of T

1条回答
  •  北荒
    北荒 (楼主)
    2021-01-19 19:54

    Found the solution myself:

    import tkinter
    root = tkinter.Tk()
    print(root.tk.exprstring('$tcl_library'))
    print(root.tk.exprstring('$tk_library'))
    

    0 讨论(0)
提交回复
热议问题