Online Tcl and Tk Tutorials

Difference between version 231 and 232 - Previous - Next
<<toc>>

Document various useful online or interactive Tcl and Tk tutorials.  The
official Tcl tutorial is discussed at [tcltutorial].

These lists have been organized into "tutorial" order, i.e., the order a reader
might access them in for most efficient learning.  This order takes into
account both the quality of the tutorial and the complexity of the information
it presents.

'''Note:''' This ordering was undertaken on 2012-08-22, and updated on 2013-03-08

Please help collaboratively bubble-sort this list by choosing two consecutive
references, evaluating their content, and swapping their order if appropriate!
New links should be added at the top of a list to give them the benefit of the
doubt, after which, the bubble-sort process will hopefully take them to their
proper place



**Tcl Tutorials**

%| Title/Link | Description | Note |%
&| [http://zetcode.com/lang/tcl/%|%Tcl Tutorial] | by Jan Bodnar.  Exceptionally clear and readable |&
&| [http://www.tutorialspoint.com/tcl-tk/%|%Tcl Tutorial] | by TutorialsPoint .  PDF download avilable | This site sometimes has very outdated ways of doing things. Be warned. |&
&| The official [tcltutorial%|%Tcl Tutorial%|%] | A [Tcl] 8.5 tutorial written by [Clif Flynt], [Neil Madden], [Arjen Markus], [David Welton] and others. The tutorial is intended as a companion to the Tcl manual pages which provide a reference for all Tcl commands. | It was written with the goal of helping those who have some knowledge of programming, although they certainly don't have to be experts. |&
&| http://www.invece.org/tclwise/| ''Tclwise: Guide to the Tcl programming language'', by [Salvatore Sanfilippo].  This book is an introduction to the main ideas of the Tcl programming language: If you wish to learn a simple and powerful programming language, this book is for you. | [RS] highly recommends this - when reading it, I more than once thought, "wish I had written that myself..." :)|&
&| [https://www.wibit.net/course/Tcl%|%Programming in Tcl] | Video tutorial on Tcl. Multiple chapters. Seems pretty complete. |&
&| https://en.wikibooks.org/wiki/Tcl_Programming | A wikibooks complete and free Tcl/Tk book/tutorial with nice examples by [Richard Suchenwirth] | |&
&| [http://aquamentus.com/tcl_tutorial.html%|%Tcl Tutorial] ,by        Chris verBurg | No mention of [{*}], but lots of small examples| |&
&| http://openocd.sourceforge.net/doc/html/Tcl-Crash-Course.html | Tcl Crash Course ,openocd project | |&
&| [https://github.com/pooryorick/learnxinyminutes-docs/blob/master/tcl.html.markdown%|%Learn Tcl in Y Minutes] | by [PYK]. A concise walkthrough and cheatsheet for Tcl 8.6 |  |&
&| http://philip.greenspun.com/tcl/index.adp | ''Tcl for Web Nerdy'', by [Philip Greenspun], An intro to Tcl using [AOLServer] as the web engine. | Some additional tutorials are mentioned in the summary|&
&| [http://jan.newmarch.name/ProgrammingUnix/tcl/tcl_tut.html%|%Tool Command Language] | by Jan Newmarch | |&
&| [http://spin.niddk.nih.gov/NMRPipe/ref/tclguide/%|%Tcl Scripting with nmrWish] | last updated 2009-09-14 | |&&| http://tcl.projectforum.com/young ''Broken link''| a work in progress providing a tutorial for young people. | |&
&|[Beginning Tcl] | An interactive community project to teach Tcl scripting | On this wiki |&
&|[Arts and Crafts of Tcl-Tk Programming]|and another index to introductory pages, or pages covering fundamental concepts. | On this wiki |&
&|[Intermediate Tcl]|an intermediate tutorial | composed of pages on this wiki |&
&|[Advanced Tcl]|another, more advanced tutorial | composed of pages on this wiki |&
&|[Superlinux] Tcl/Tk Video Tutorials| Youtube playlists in Arabic and English, of video tutorials http://wiki.tcl.tk/28835%|%Superlinux%|% on his channel ( http://www.youtube.com/user/ranixlb%|%ranixlb%|%) . More than 36 episodes of tutorials. |https://play.google.com/store/apps/details?id=net.superlinux.tcltktutorialspaid%|%Install this Android application%|%|&
&|[Superlinux] Tcl/Tk AndroWish Video Tutorials|Those are video tutorials in spoken Arabic and in English packaged in an Android app. Teaches You how to make applications on Android using Tcl/Tk|http://play.google.com/store/apps/details?id=net.superlinux.tclandrowishtutorialsfree%|%Download from here.%|% |&
&|[Superlinux] Tcl/Tk Video Tutorials| Recently (2019) liberated materials from [Superlinux] in English. | https://www.youtube.com/playlist?list=PL7616FA0112D74AD3%|%In the form of a youtube playlist.%|% |&
&| http://www.ardenstone.com/projects/seniorsem/tcl/ | ''A Non-Programmer's Introduction to Tcl/Tk'' | Stuck with pre-2005 practices, but the basics have changed little since then. |&
&| http://www.cwflynt.com/CS146GameLab/ | Clyf Flynt's Tcl Tutorial | |&
&| http://www.icanprogram.com/09tk/main.html | icanprogram website | |&
&| http://www.bin-co.com/tcl/tutorial | An online tutorial written by [Binny V Abraham].|Out of date (pre-8.5) or maybe even older |&
&| http://www.doulos.com/knowhow/tcltk/ | Doulos offers a 3-day Essential Tcl/Tk instructor led class | |&
&| [Tcl Tutor] | an interactive tutorial for learning Tcl | Recent versions cover only Tcl, '''not''' Tk |&&| http://www.purl.org/NET/Tcl-FAQ/ ''Broken link''| has a variety of pointers to tutorials | |&
&| http://groups-beta.google.com/group/comp.lang.tcl/msg/7f593de071477d64 |[Roy Terry] recommends a particularly experimental trajectory. | |&&| http://www.phaseit.net/claird/comp.lang.tcl/tcl_tutorials.html ''Broken link''| contains pointers to a varity of tutorials | |&
&| ftp://www.tcl.tk/pub/tcl/doc/tut.tar.Z | A series of PostScript slides used in an introduction/tutorial on Tcl and Tk at several X and Usenix Conferences | |&
&| http://jbenjamin.com/docs/tcl.html | ''A Tcl/Tk and Expect Tutorial'' by [Will Morse] (mailto:[email protected]) | |&
&| http://www.icanprogram.com/<<br>>http://www.icanprogram.com/09tk/main.html | free online (beginner level) programming courses using Tcl/Tk as a programming language | |&
&| http://photo.net/ | filled with interesting information for the Tcl programmer.  For instance,  http://photo.net/sql/  appears to be a working draft of a book initially called "SQL for Web Nerds".  It is a tutorial on SQL, using the AOLserver as a base and Tcl as the programming language.  There are other items such as http://photo.net/wtr/dead-trees/ , which is the web version of the book "Database Backed Web Sites".  Then there is the ArsDigita Community System, a database driven web forum. | |&
&| http://user.xmission.com/~georgeps/documentation/tutorials/ | [George Peter Staplin] [GPS] has written some tutorials on how he uses movies, audio, images and PNG cursors with Tcl/Tk in a game he is writing. | |&
&| http://tldp.org/HOWTO/TclTk-HOWTO.html | A rather old document oriented towards Tcl/Tk 8.0 | Perhaps one of the Linux users here on the wiki would consider updating http://cvs.tldp.org/go.to/LDP/LDP/howto/linuxdoc/TclTk-HOWTO.sgml?revision=HEAD&view=markup and then submit the changes back to tldp.org ? |&&| http://www.oreillynet.com/pub/a/mac/2003/12/16/begin_programming.html ''Broken link''| Michael Norton's ''Elementary Computer Graphics'' article is a Tcl tutorial | |&
&| ftp://ftp.oreilly.com/pub/convention/os/tutorial/tcltk.pdf | by Scriptics | one of the best Tcl/Tk tutorials imho |&
&| http://www-106.ibm.com/developerworks/edu/l-dw-linuxtcl-i.html?S_TACT=103AMW03&S_CMP=EDU | IBM beginners ''Tcl/Tk quick start'' web-based tutorial.  This introduction is not fully up-to-date, and has enough questions and errors that one might hesitate to point newbies to it. | This tutorial has proven to be less then ideal (written by a non-Tcl type), so this one should be last on your list of sites to learn about Tcl. |&
&|https://www.youtube.com/channel/UCXLcY5Ik9mbHDCD3jyAR7zA | YouTube Channel "Web of Engineering" - There are some vídeos for very beginners in Tcl/Tk language. | The tutorials are in portuguese, but there are links to GitHub where you can download the codes created during the tutorials.|&  
**[Tk] Tutorials**

%| Title/Link | Description | Note |%
&| [http://zetcode.com/gui/tcltktutorial/%|%Tcl/Tk tutorial] | By Jan Bodnar.  Concise, clear, easy to read |&
&| http://www.tkdocs.com/tutorial/index.html | An excellent tutorial on [Tk] & [ttk] [best practices] by [Mark Roeseman]. Covers [Perl], [Ruby] and (soon) [Python] language bindings to Tk, as well as [Tcl]. | |&
&| http://www.icanprogram.com/09tk/main.html | icanprogram website | |&
&| http://www.cwflynt.com/CS146GameLab/ | Clyf Flynt's Tcl Tutorial | |&
&| http://tldp.org/HOWTO/Scripting-GUI-TclTk/ | old document, but good for beginners | |&

**Tcl Web/[CGI]/[HTML] Tutorials**

   * [BOOK Tcl for Web Nerds] is an online book/tutorial. [CL] advises regarding updates of this resource: "Not recently.  FAR from recently.  And its culture is quite different from what most Web beginners in 2008 expect.  It's the best suggestion I know, though."

   * Tutorials about Rivet ( The Tcl alternative to PHP ) as a video playlist packaged in an Android application. Made by [superlinux]. http://play.google.com/store/apps/details?id=net.superlinux.tclrivettutorialspaid%|%Get from here%|%


**Other languages**

   * A book written in Arabic about how to program in Tcl, and how to use Tk in Tcl. It's an Android Application . https://play.google.com/store/apps/details?id=net.superlinux.tcltkebook%|%Get it here%|%

   * French tutorials can be found on the french Wiki: http://wfr.tcl.tk/1140

   * Polish Tcl/Tk tutorial can be found at http://sqlitestudio.one.pl/tcltut/

   * A WWW resource for what appears to be a German introduction/tutorial on Tcl and Tk is at  http://www.tu-chemnitz.de/home/stb/tcl_tk/tcl_tk.html - ''MEd 2006/03/09: Site does not seem to exist any more''

   * A German Tutorial (Tcl only, no Tk) is available in PDF format at https://www.bg.bib.de/portale/bes/pdf/Einfuehrung_Tcl.pdf
   * A German coach for learning Tcl/Tk : http://www.tcl-coach.de/
   * A German book for learning Tcl/Tk : http://www.tcltk.info/buch.html

**Specialized/Advanced**

%| Title/Link | Description |%
&| http://psg.com/~joem/tcl/CmdWrite.html | An HTML version of the TclCommandWriting man page that comes with TclX. Explains the C API to Tcl, providing an introduction/tutorial on writing Tcl extensions. [APN] This page is way out of date as it is based on the old char* based APIs and not Tcl_Objs.|&
&| http://www.cs.man.ac.uk/~fellowsd/tcl/option-tutorial.html | A tutorial on the [option] database |&
&| http://captaincrumb.browseireland.com/docs/computing/tcl/tk/canvas/ | Captain Crumb explains [canvas]es, with a focus on animation. | |&
&| http://www.markroseman.com/tcl/mktcl.pdf | tutorial on [Metakit] by [Mark Roseman] |&
&| http://www.magicsplat.com/book | Chapters on Tcl programming for Windows |&
&| http://www.magicsplat.com/articles/oo.html | Tutorial on [TclOO] |&
&| http://www.magicsplat.com/articles/tdbc.html | Basic Introduction to [TDBC] |&
**Other related pages on this wiki**

   * The pages on [Expect], [TclXML], ... refer to several tutorials.

   * [Teach programming to children], again.

   * [Tcl Articles] is a page here on the Tcler's Wiki that points to various articles in the printed and electronic press.  These frequently provide tutorial level information.

   * [Online tutorials]

** Dead References **

The following references currently seem to no-longer be accessible.  Rather
than delete them, they are listed here as an aid to discovering lost content.
Before moving references ot this section, try to confirm that the resource is
really gone, and not just temporarily unavailable.  Also, it may be possible to
link to an archived version of the original content, perhaps at
http://www.archive.org.

%| Title/Link | Description | Note |%
&| Source code: [ftp://ftp.ora.com/pub/examples/xresource/issue11/TclTk.tar.Z] | The X Resource, Issue 11 (July 1994), pp 205-248: ''A tutorial Introduction to Tcl and Tk'', by Graham A. Mark [http://portal.acm.org/citation.cfm?id=183094.183105&dl=GUIDE&dl=GUIDE,GUIDE&CFID=29047242&CFTOKEN=16205137] | |&
&| http://www.cs.tamu.edu/people/mmiller/tcl/ | Tcl 8.0 tutorial by Michael S. Miller, based on the [John Ousterhout] tutorial, as well as Tcl UDP and a disk usage application.  The creator also has some online doc for Tcl UPD and Tcl channels at http://www.cs.tamu.edu/people/mmiller/tcl/channel.html | |&
&| http://www.swen.uwaterloo.ca/~dasiewic/courses/ece452/local/old_tuts/trudeau-tck-intro.pdf | | |&


----
'''[dprasad] - 2016-06-08 19:54:52'''

Hi,
i have 2 lists 
list1 = {1 2 3 4 5}
list2 = {6 7 8 9 }

i want to merge two lists to a new list which gives a result {1 2 6 3 4 7 5 8 9}
it will take 2 element from list1 then 1 element from list2 and when condition finish it will print as it is shown in the above example.

please write a generic code.

Let's move this to [TCL programs for beginners] after you read it, not very concise but it could be a good basic example:
 set result {}
 set list1 {1 2 3 4 5}
 set list2 {6 7 8 9}
 foreach {eL1a eL1b} $list1 eL2 $list2 {
    if {[info exists eL1a] && $eL1a != ""} {lappend result $eL1a}
    if {[info exists eL1b] && $eL1b != ""} {lappend result $eL1b}
    if {[info exists eL2]  && $eL2  != ""} {lappend result $eL2}
 }
 puts $result

or

======
set list1 {1 2 3 4 5}
set list2 {6 7 8 9}
set result [concat {*}[lmap {a b} $list1 c $list2 {
    concat {*}[list $a $b $c]
}]]
======

or

======
set result {}
set list1 {1 2 3 4 5}
set list2 {6 7 8 9}
foreach {a b} $list1 c $list2 {
    lappend result $a $b $c
}
set result [lmap item $result {
    if {$item ne {}} {
        set item
    } else {
        continue
    }
}]
======

<<categories>>  Tutorial | Online Tutorials