[IronPython] IronPython versus Tkinter...
Kevin Bjorke
KBjorke at nvidia.com
Mon Jun 5 17:50:55 CEST 2006
You're right Kurt if the script (app) was the *entire* app, but in my
case that's not true, the choice of "which python" is not mine... My
constraint is that my app (script) runs within other apps. I have one
host app that's got integrated IronPython scripting support, and another
that has integrated Cpython scripting support, and a desire to write one
app that shares as much as possible between the two (though I
anticipated that this might be a problem, and did keep the UI code
well-partitioned away from the underlying functions). Supporting two
different UI paths is... Well, twice as much work!
Back in the ancient days, I recall that one of the python-advocate
battle cries was that the language was less important than the
readily-available, easy-to-use, and platform-agnostic modules.
I suspect that a lot of folks other than myself expect "python *plus*
.NET services" and perceive "python" as meaning "python and its typical
modules" -- rather than ".NET services *instead of* the python stuff you
thought you already knew and could leverage."
Thanks for the strategy ideas, I'll have to look at the options a bit
harder. (Why can't everything just be perfect? :) )
KB
-----Original Message-----
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Kurt Harriger
Sent: Sunday, June 04, 2006 10:11 PM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] IronPython versus Tkinter...
Sounds like you're just using the wrong tool for the task at hand.
If CPython has what you need and you don't want or need to use .Net then
why
not just use CPython? Sorry, I couldn't help but point that out :).
I agree that it would be nice to be able to use more of the existing
python
libraries without additional modification. I had a small issue myself
experimenting with PLY as it apparently depends on md5, but in that case
I
it turned out to be rather trivial to replace with the .net
implementation.
Although IronPython doesn't support C extensions, perhaps you can use a
C#
class to wrap the win32 calls and import that, seems like it could work.
If
all else fails you could use CPython - it's just a bit slower :)
- Kurt
> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] On Behalf Of Kevin Bjorke
> Sent: Sunday, June 04, 2006 10:12 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] IronPython versus Tkinter...
>
> That is bizarre, considering that Tk works fine under windows. Theu
> underlying purpose of python seems to be subverted by the lack of what
> most folks think of as basic python services, no?
>
> kb
>
> -----Original Message-----
> From: users-bounces at lists.ironpython.com
> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord
> Sent: Sunday, June 04, 2006 1:01 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] IronPython versus Tkinter...
>
> Kevin Bjorke wrote:
> >
> > Any clues on running this under Beta7, or is it currently
> non-functional?
> >
> > I want to be able to run a GUI under both IronPython and Cpython
since
>
> > my app's intent targets two different kinds of host machine.
> >
> > Current behavior:
> >
> > I have a Tkinter app called "smtk" which I call from this shell:
> >
> Tkinter is a C extension "_tkinter.pyd".
>
> C extensions are not currently supported (nor likely to be supported)
by
>
> IronPython.
>
> A cross-platform GUI for IronPython/CPython doesn't currently exist -
> perhaps you can build an abstraction layer over the top of your GUI
code
>
> which detects the underlying platform ?
>
> Michael Foord
> http://www.voidspace.org.uk/python/index.shtml
>
> > import sys
> >
> > addThesePaths = ['c:\\Python24\\lib',
> > 'c:\\Python24\\lib\\plat-win',
> > 'c:\\Python24\\lib\\lib-tk',
> > 'c:\\Python24',
> > 'c:\\Python24\\lib\\site-packages']
> >
> > for p in addThesePaths:
> > print "Adding %s" % (p)
> > sys.path.append(p)
> >
> > import smtk
> >
> > Which works fine in cpython but under IronPython I get:
> >
> > Adding c:\Python24\lib
> > Adding c:\Python24\lib\plat-win
> > Adding c:\Python24\lib\lib-tk
> > Adding c:\Python24
> > Adding c:\Python24\lib\site-packages
> > Traceback (most recent call last):
> > File e:\devrel\Playpen\kbjorke\python\ipsm.py, line 13, in
> Initialize
> > File , line 0, in __import__##3
> > File e:\devrel\Playpen\kbjorke\python\smtk.py, line 3, in
Initialize
> > File , line 0, in __import__##3
> > File c:\Python24\lib\lib-tk\Tkinter.py, line 38, in Initialize
> > File , line 0, in __import__##3
> > ImportError: No module named _tkinter
> >
> > Am I missing some important path or step?
> >
> > Thanks
> > KB:
> >
> >
>
------------------------------------------------------------------------
> > This email message is for the sole use of the intended recipient(s)
> > and may contain confidential information. Any unauthorized review,
> > use, disclosure or distribution is prohibited. If you are not the
> > intended recipient, please contact the sender by reply email and
> > destroy all copies of the original message.
> >
>
------------------------------------------------------------------------
> >
>
------------------------------------------------------------------------
> >
> > _______________________________________________
> > users mailing list
> > users at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
>
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
More information about the Ironpython-users
mailing list