TCL TK. Tcl/Tk C functions can become Tcl commands that are invoked interactively Tk = scriptable, portable user interface –Windows, X (Unix), MacOS,

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Intro to Python Welcome to the Wonderful world of GIS programing!
Programming Using Tcl/Tk These slides are based upon u several Tcl/Tk text books u material byDr. Ernest J. Friedman-Hill.
CSET4100 – Fall 2009 Perl Introduction Scalar Data, Operators & Control Blocks Acknowledgements: Slides adapted from NYU Computer Science course on UNIX.
1 Javascrbipt Intro Javascript (or js) is a programming language. Interpreted, not compiled. Not the same as java, but, similar. Use tags to use. Object-oriented.
CS 898N – Advanced World Wide Web Technologies Lecture 14: JavaScript Chin-Chih Chang
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Introduction to Tcl and Tk Outline –The Tcl Language –The Tk Toolkit –Tk Applications –Composing Applications –Status and Conclusions Goal –Understand.
Programming for Image Processing/Analysis and Visualization using The Visualization Toolkit Week 2: An Introduction to Tcl Xenios Papademetris
Tcl and Tk CSE 470 Fall 1999 Revised by Prasad. Objective To use Tcl Tk to develop GUI and prototype of the project.
Tcl/TK Tutorial Fan Yang Kristy Hollingshead
Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011.
Scripting Languages. Originally, a script was a file containing a sequence of commands that needed to be executed Control structures were added to make.
Guide To UNIX Using Linux Third Edition
1 Outline 7.1 Introduction 7.2 Implementing a Time Abstract Data Type with a Class 7.3 Special Attributes 7.4Controlling Access to Attributes 7.4.1Get.
Introduction to Python. What is Python? Interpreted object oriented high level programming language – No compiling or linking neccesary Extensible: add.
Python Introduction.
An Introduction to Unix Shell Scripting
Introduction to python-getting started CMPD 124 INTRODUCTION TO PROGRAMMING AND PROBLEM SOLVING TECHNIQUES.
GNU Compiler Collection (GCC) and GNU C compiler (gcc) tools used to compile programs in Linux.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk.
CSC 352– Unix Programming, Spring 2015 March 2015 Shell Programming (Highlights only)
Systems Software Operating Systems. What is software? Software is the term that we use for all the programs and data that we use with a computer system.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
Tcl/TK Tutorial. 2 Learning Tcl/TK What is Tcl/TK? –An interpreted programming language Build on-the-fly commands, procedures Platform-independent Easy.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
1 Programming in C Hello World! Soon I will control the world! Soon I will control the world!
Intro to Python Adriane Huber Debbie Bartlett Python Lab #1Python Lab #1 1.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
JavaScript Syntax, how to use it in a HTML document
I NTRODUCTION TO PYTHON - GETTING STARTED. W HAT IS PYTHON ? An elegant and robust programming language which delivers powerful and general applicable.
Writing Scripts Hadi Otrok COEN 346.
Shell Programming Learning Objectives: 1. To understand the some basic utilities of UNIX File 2. To compare UNIX shell and popular shell 3. To learn the.
RUBY by Ryan Chase.
9-Nov-97Tri-Ada '971 TASH An Alternative to the Windows API TRI-Ada ‘97 Terry J. Westley
Introduction to Tcl/Tk TraNese Christy U.S. Army Research Laboratory.
 Stands for Tool Command Language  Used for rapid prototyping, GUIs, and scripted applications  Created by John Ousterhout in 1988 out of frustration.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
Scripting.
Python 1 SIGCS 1 Intro to Python March 7, 2012 Presented by Pamela A Moore & Zenia C Bahorski 1.
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Dept. of Animal Breeding and Genetics Programming basics & introduction to PERL Mats Pettersson.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
An Introduction To Tcl Scripting John Ousterhout Sun Microsystems Laboratories Tcl/Tk Tutorial, Part II.
TCL/TK Tool Command Language/Tool Kit. What is TCL? u Tool Command Language u An interpreted programming language  Created by John Ousterhout.John Ousterhout.
Perl & TCL Vijay Subramanian, Modified from : perl_basics_06.ppt.
Overview of VANET Project(2011) on NS2 Perspective Part 1 of 2 Jae-Myeong Lee Human-centric Mobile Computing Lab.
CST 1101 Problem Solving Using Computers
Department of Computer Engineering
PowerShell Introduction Copyright © 2016 – Curt Hill.
CSC 352– Unix Programming, Spring 2016, Final Exam Guide
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
CSC 352– Unix Programming, Fall 2012
CAP652 Lecture - Shell Programming
Programming Basics Web Programming.
Server-Side Application and Data Management IT IS 3105 (Spring 2010)
Henning Schulzrinne Advanced Programming
TCL/TK Tool Command Language/Tool Kit.
PYTHON Varun Jain & Senior Software Engineer
An Introduction to Python
Learning Outcomes –Lesson 4
LING 408/508: Computational Techniques for Linguists
CSC 352– Unix Programming, Fall, 2011
12th Computer Science – Unit 5
Chapter 1: Programming Basics, Python History and Program Components
Bash Scripting CS 580U - Fall 2018.
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

TCL TK

Tcl/Tk C functions can become Tcl commands that are invoked interactively Tk = scriptable, portable user interface –Windows, X (Unix), MacOS, MacOS X –also found in Python and Perl GUI extensions –scripts can send commands to each other

Tcl history Developed in late 1980s by John Ousterhout first release ~1991 Tk usable around 1992 see

Tcl/Tk features high-level scripting language –less code than Win32 interpreted –execute directly, without compiling or linking extensible –commands in Tcl or C embeddable –Tcl interpreter callable from C most platforms –Unix, Mac, Windows –hides UI, system call differences autoloading –automatically load libraries free –source –no royalties

Using Tcl/Tk Three modes: 1.tclsh for interactive use $ tclsh % set x wish for window programs $ wish % button.b –text “Hello” –command exit % pack.b

Tcl/Tk script files Script file: #!/usr/local/gnu/bin/wish –f button.b –text "Hello, world!" \ –command exit pack.b

Basic operations print to screen ( puts ) puts –nonewline "Hello, world!" puts "!!" assignment ( set ) set income puts "income is $income" (using '$' to get the value of a variable) mathematical expressions ( expr ) set a 10.0 expr $a + 5 expr int($a/3)

Some useful commands unset : destroy a variable unset num info : check whether the named variable has been defined if {![info exists num]} { set num 0 } incr num window commands wm withdraw. console show

Special characters # : single-line comments, similar to "//" in C \ : escape character, same function as in C : also used to break a long line of code to two lines $ : get the value of a variable –var : name of variable –$var : value of variable [] : evaluate command inside brackets

Control structures if then else set income if {$income > 30000} { puts "$income -- high" } elseif {$income > 20000} { puts "$income -- middle" } else { puts "$income -- low" } while loops set i 0 while {$i < 100} { puts "I am at count $i" incr i }