[Pythonmac-SIG] Problems using tkinter when linking against Python.framework

Jens Miltner jum at mac.com
Mon Mar 15 19:12:36 EST 2004


Hi all,

I'm trying to get the Python integration in MacCvsX fully working, but 
I have problems getting the tkinter module to be properly 
loaded/recognized when executing Python code from within MacCvsX.
I can properly use tkinter when executing python code from the 
commandline (via pythonw), but when executing the same python code from 
within MacCvsX, I get a backtrace with the error being "NameError: name 
'Tk' is not defined"...

'Regular' python macros can be executed just fine, but the Tk 
integration just doesn't work.

MacCvsX is linking against the Python.framework (or actually, it's 
loading the framework dynamically if it's available) and executes the 
python macros via PyRun_SimpleString (which actually triggers a 
well-defined piece of python code, which in turn calls the selected 
macro's "Run" member).

Now, apparently, there's a difference between loading the Python 
framework and what's being done in the python commandline tool. Is 
there anything special I need to initialize / setup / call when loading 
the Python.framework so that I can properly use Tk via tkinter?

Any ideas - I'm pretty new to python, so I don't know a lot about the 
internal details :(

Thanks,
</jum>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2351 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040316/793b764a/smime.bin


More information about the Pythonmac-SIG mailing list