Embedded Python and Tkinter / win32gui

  • Thread starter =?ISO-8859-1?Q?Thomas_N=FCcker?=
  • Start date
?

=?ISO-8859-1?Q?Thomas_N=FCcker?=

Hello!

I am using the python dll within a visual-c++ project. In the project
i am also handling python scripts. Since i want to use some
message-boxes i want to have the opportunity to import modules in the
script.

Now there is the question:
How do i have to configure / compile the python-dll so i can use the
tkinter-module or the win32gui module? Is this only a problem of where
the modules are storred, or has the compilation of the python-dll
specially to be configured?

Thank you for your answer,

Thomas Nücker
 
F

Fredrik Lundh

Thomas said:
I am using the python dll within a visual-c++ project. In the project
i am also handling python scripts. Since i want to use some
message-boxes i want to have the opportunity to import modules in the
script.

Now there is the question:
How do i have to configure / compile the python-dll so i can use the
tkinter-module or the win32gui module? Is this only a problem of where
the modules are storred

just make sure that Python can find them, for example by calling
Py_SetPythonHome with the installation "root" directory (put the
files in <root>/Lib and <root>/DLLs etc, just like the standard
Python install does).

alternatively, you can manipulate the PYTHONHOME or PYTHONPATH
environment variables before initializing the Python interpreter.

(if you need more alternatives, check the Python source code)
or has the compilation of the python-dll specially to be
configured?

hopefully not.

</F>
 
?

=?ISO-8859-1?Q?Thomas_N=FCcker?=

I configured the paths, so Python can find them, but i further on get
the following error in my program:

File "c:\Python22\lib\lib-tk\Tkinter.py", line 25 in ?
import _tkinter # if this fails your Python may not be configured
for Tk

Where could be the error and how can I configure Python for Tk?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top