tcl/tk vs. python/Tkinter - Example attached

Daniel Kramer daniel at visionart.com
Tue Jun 13 18:10:56 EDT 2000


I have just started to use python this last week.. I wanted to port a
tcl/tk app to it and see how I like working with it.  As far as
programming with it I like it more.. but just as I got started on my app
I noticed some speed differences in TK.  The tcl/tk app is much more
responsive then the python/Tkinter app.

I have put together a simple example done both ways.. it's attached to
this mail.

Within the tar you will find:

canvas.tcl - This is just a simple tcl/tk prog.. 2 rectangles are added
to a canvas and you can move them around with the mouse.

canvas.py - This is the same thing written in python/Tkinter.
nodeUI.py - This contains most of the classes/functions to drive the
canvas.py.. it should be in the same dir as canvas.py


Since I am new to this lang I was just wondering if there was a way to
get better python/TK performance... if anyone could try out the examples
and let me know.. for me the tcl/tk one feels much more responsive but I
don't have any hard numbers to prove that.

I have been reading that wxWindows is the much faster solution.. but I
am very familiar with TK and it's plenty fast for what I need.. but I
worry that the Tkinter ver won't be fast enough once I add alot more to
it.


-Daniel


begin 666 canvas.tar.gz
M'XL("'FP1CD``V-A;G9A<RYT87(`[5C=;Z-&$+]7[U\Q(CX)4G`!AZ0ZU95Z
MO9<^)`]M3]=3A"P,:QL=!@O6"2AW_WMG/_ at PMI.+JMRU$B,YQO.QS,[,;W8V
M89#>!<5D6[UZ.;)M^_+R$O#;=:87_!N?//G-R?.F8%\YKN.Y5^[4`]N9>H[[
M"NP7]*FA7<&"'%V)@C2FR6F]N[B(L_2T7&X%FN__"1&RS+,-_/4I3AG-(=YL
MLYS!.5$/:1;1][\3<G;V=A<G$?PFRH6`(L*R[8<XA1DNH!LDQ`>IH4N!N0C"
M3ZL\VZ41BK153JLK6S-AD>41S>_CB*V1[YJPIO%JS?#YPK9-R&D2TR6WR.-H
M1=&@5D4QX'LF6UQ7#])PG>5<+:3<>\VDY380KW),6,9)PF6+C*TU at Q"RJ?AN
MD"4W-;G!+STT-?[300TIGX0Y#1C5'<\V\6/4=NYQ0[<Q=&M+%RU=:1G$:9)E
M6YV_GGSO5!^E4.*?A8^4_K^E)_`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RCH2<49.A/344\B3GTI at 1_J2:RG(P[EC@[_W='Y(`;)
M">\<>L<7$S3L-'A-%;SY?)/M"OHNNT^-KS)M^T]OB6MLCE^YQ(ZQ+/V#)A0W
M91WX\GYKX+DN%N%)41=5D9)R9IL5?NYG>&U=SUS/#+-$WJKE;*29V8YAJZ#S
M1K!(<,!O^??\#B_RJ4:M&>BZ+L8_L!SCG)?%1%2+J>OKHVRAW&6L]QG&T1I0
M-^YY,S#JTH'F\B\\-H%//.A34Q]F4P^&6?]GH=G,XZ_B!:';IFVJ2FG7/'@)
M-!5E]-?DIYY>FE6'WV9'"&5N4./-<7<:)?FN$BQHP616W9]5_^TUX,H3@*LZ
MI=(I9ND3T#M$^B%Z!7M2=ME5P\:C>222N=\HNAM2!Y:N*17-0!L</O2$IGK?
MUA#OWPL(^R0'M@/=6]LW^LK\_`NS=!FOCJFWW<&L_XF4TT at X1+I!>;\]",DS
M''ZV#PJ.QF%VKIN*:5P1*L]Q1Q34$4?,.K/[%58GME=HSRL*<4QT=Q/11!T5
LPL$M'CEDR/]+YO][SQ\##3300`,---!``PTTT$`##330R],_QS*[S0`H```5
`
end


--
-----------------------------------------------------------------------------
Daniel Kramer
http://www.visionart.com/~daniel/
daniel at visionart.com:           VisionArt Design and Animation






More information about the Python-list mailing list