[PythonCE] Tkinter module importing
isrgish at fastem.com
Wed Aug 25 03:20:20 CEST 2004
>From: "Mark Doukidis"<mdoukidis at gmail.com>
>Sent: 8/24/04 6:17:05 AM
>To: "PythonCE at python.org"<PythonCE at python.org>
>Subject: [PythonCE] Tkinter module importing
>Question: Why is does the module "Tkinter" not "import" like other modules ?
>Comments I have seen posted are to perform:
>>>> import sys
>>>> sys.path.append('\\Program Files\\Python\\lib\\Python23.zip\\lib-tk')
>>>> import Tkinter
>While this works it seems strange to me that this effort is required
>Can someone enlighten me on this topic ?
The reason for this is that for any module to import, Python needs to know where it is located. For that there is a list of folders that python searches. That list is in sys.path. So in order for python to know where to look for the module "Tkinter" which is located in the lib\lib-tk folder. We have to tell python to look there.
I hope this was clear.
All the best,
>PythonCE mailing list
>PythonCE at python.org
More information about the PythonCE