Re: [Tutor] OT, Tcl Python
On 7/16/05, Alan G [EMAIL PROTECTED] wrote: I was wondering if someone knowledgeable of both Tcl and Python could suggest whether it would be a good or a bad idea to write a Python/Tk application, with the motive to rewrite the application in Tcl/TkOooh that's a tough one, it would depend on the program.Python is a very different language to Tcl and you would needto write the code in a Tcl style - don't use an OOP style for the GUI for example. In fact I'd avoid OOP all together sinceTcl OOP is significantly different to Python OOP and not evenpart of standard Tcl. ... You might like to take a quick run through the basics of my oldPython tutor which used Tcl as a comparison to Python. Its far from comprehensive but would give a fairly good Python viewof Tcl.http://www.freenetpages.co.uk/hp/alan.gauld/oldtutor/index.htm HTH,Alan GAuthor of the Learn to Program web tutorhttp://www.freenetpages.co.uk/hp/alan.gauld Thanks, this is a really good point. I've been examining incr Tcl with interest, but to learn Tcl/Tk by porting code from Python, its probably best to avoid incr Tcl/incr Widgets at first. Your tutor is really great, I've skimmed through it a bit, and will give it a more thorough read shortly. Thanks! Luis N ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] OT, Tcl Python
Why do not do this entirely in Python ? The answer is in the original post: past. My motivation is the greater ease of deployment across systems that Tcl seems to offer, with Starkits and Starpacks, cumbersome. A typical GUI app is approximately 5 MB in python, distributed as a collection of files in a folder, whereas a Tcl Starpack is a compact 1 MB, distributed as a single file executable. So primarily the OP was interested in small easily distributed files. Tcl generally beats Python at that game. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] OT, Tcl Python
Am Samstag, den 16.07.2005, 01:19 -0700 schrieb Luis N: Hi, I was wondering if someone knowledgeable of both Tcl and Python could suggest whether it would be a good or a bad idea to write a Python/Tk application, with the motive to rewrite the application in Tcl/Tk once completed. My reason for considering this route is that I have never written a single line of Tcl code nor coded a Tk application in the past. My motivation is the greater ease of deployment across systems that Tcl seems to offer, with Starkits and Starpacks, http://www.equi4.com/starkit.html Tcl also appears useful to learn, for writing scripts in tclsh, etc. Well, Tcl isn't really a language. Or if it is, it's so trivial that it is usually explained without a BNF grammar. tclsh is basically a shell (like /bin/sh), which has been designed to be easily extendable with C functions. Tcl had only a string data type for most of it's life. (Other data types like integer where added only in the last years ;) ) Tcl is quite cool as a glue language, but implementing anything beyond 100-lines scripts is painful. OTOH it's certainly a good idea to learn Tcl (and it's C API). Andreas I've experimented with py2exe in the past, which seems fine for Windows, although I have never tried py2app, and this approach seems cumbersome. A typical GUI app is approximately 5 MB in python, distributed as a collection of files in a folder, whereas a Tcl Starpack is a compact 1 MB, distributed as a single file executable. Sincerely, Luis ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor signature.asc Description: Dies ist ein digital signierter Nachrichtenteil ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] OT, Tcl Python
I was wondering if someone knowledgeable of both Tcl and Python could suggest whether it would be a good or a bad idea to write a Python/Tk application, with the motive to rewrite the application in Tcl/Tk Oooh that's a tough one, it would depend on the program. Python is a very different language to Tcl and you would need to write the code in a Tcl style - don't use an OOP style for the GUI for example. In fact I'd avoid OOP all together since Tcl OOP is significantly different to Python OOP and not even part of standard Tcl. Its much harder to translate a Python script to Tcl than to translate Python to C++ or Delphi or even Perl because they have different underlying philosophies. You could just translate line by line but the end program wouldn't look like anything a Tcl programmer would recognise! My reason for considering this route is that I have never written a single line of Tcl code nor coded a Tk application in the past. You might like to take a quick run through the basics of my old Python tutor which used Tcl as a comparison to Python. Its far from comprehensive but would give a fairly good Python view of Tcl. http://www.freenetpages.co.uk/hp/alan.gauld/oldtutor/index.htm motivation is the greater ease of deployment across systems that Tcl seems to offer, with Starkits and Starpacks Tcl has several nice features there, but if you just deploy the scripts its not much different to Python. And since I hate bloatware I nearly always deploy the scripts and interpreter separately. also appears useful to learn, for writing scripts in tclsh, etc. Tcl is a fun language with a wholeheap of interesting concepts new to Python programmers. So its definitely worth looking at - and its nearly always more compact than Python too. Its main limitations are lack of suitability for large projects and performance. The latter is relative and if you really need fast code use C! typical GUI app is approximately 5 MB in python, distributed as a collection of files in a folder, whereas a Tcl Starpack is a compact 1 MB Thats because the Tk GUI is a fairly big DLL including the TCl interpreter as well as Python! You are effectively distributing Tcl and Python together HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor