[PythonCE] Tkinter module importing

Isr Gish isrgish at fastem.com
Wed Aug 25 03:20:20 CEST 2004


Hi Mark,

-----Original Message-----
   >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
   >for PythonCE.
   >
   >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,
Isr

   >Mark
   >PythonCE mailing list
   >PythonCE at python.org
   >http://mail.python.org/mailman/listinfo/pythonce



More information about the PythonCE mailing list