3 ms·
Amusingly, any windows or mac python program comes with a TCL interpreter, thanks to the tkinter GUI: >>> import tkinter as tk >>> tk.Tcl().eval('puts
by BiteCode_dev 5y ago
Amusingly, any windows or mac python program comes with a TCL interpreter, thanks to the tkinter GUI:
>>> import tkinter as tk
>>> tk.Tcl().eval('puts {hello, world}')
hello, world
''
- Topgamer7 5y agoNooope, not on linux at least >>> import tkinter Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.9/tkinter/__init__.py", line 37, in <module> import _tkinter # If this fails your Python may not be configured for Tk ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
- kbr2000 5y agoOn Debian GNU/Linux Tkinter is provided by the python-tk package (might differ in other distros).
- BiteCode_dev 5y agoI specifically stated "any windows or mac python program". Indeed, most linux distro packaging teams decided to split tk in a separate package that is not installed by default. Same for pip and setuptools. Of course, this made getting a congruent python experience extra hard, on a platform with already plenty of gotchas for python setup, but hey, they saved a few Mo.
- Zababa 5y agoI didn't know about pip and setuptools being separate packages. That explains some things.
- xcombelle 5y agoOf my understanding, tkinter is not in python packages because it needs an WM to run correctly
- BiteCode_dev 5y agoOh I understand the motivation. I also know it caused a lot of pain, for very little gain.
- Qem 5y agoManu Linux distributions have tclsh preinstalled.
- cafard 5y agoJust now: $ python3 Python 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter >>> tkinter.Tcl().eval('puts {hello, world}') hello, world '' >>> Ubuntu 18.04; but it's not on a machine running 20.04