[Tkinter-discuss] Where is tkinter.py

Guido van Rossum guido at python.org
Sun Dec 22 04:18:27 CET 2013


Typically what I do in such a case is go into the interactive Python
interpreter, import the module, and then print it.

E.g. for Python 2.7 on OSX:

$ python
Python 2.7.6+ (2.7:313d9bb253bf, Nov 25 2013, 14:05:28)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
import tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tkinter
>>> import Tkinter
import Tkinter
>>> Tkinter
Tkinter
<module 'Tkinter' from '/usr/local/lib/python2.7/lib-tk/Tkinter.pyc'>
>>>

And for 3.4:

$ python3
python3
Python 3.4.0b1 (v3.4.0b1:3405dc9a6afa, Nov 24 2013, 16:45:59)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
import Tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'Tkinter'
>>> import tkinter
import tkinter
>>> tkinter
tkinter
<module 'tkinter' from '/usr/local/lib/python3.4/tkinter/__init__.py'>
>>>



On Sat, Dec 21, 2013 at 5:10 PM, Pierre Dagenais <pierre.dagenais at ncf.ca> wrote:
> Hi,
> I'm new at this stuff and I'm trying to understand what I'm doing! I
> thought that when I executed "tkinter import" a file called tkinter.py
> (a class) would be loaded for execution. Except when I search my system,
> Ubuntu 12.04, all I find is Tkinter.py in the 2.7 directory, python3.3
> has no equivalent tkinter.py?
> Can somebody explain?
>
> TU,
>
> PierreD.
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss



-- 
--Guido van Rossum (python.org/~guido)


More information about the Tkinter-discuss mailing list