Training, Open Source computer languages

This is page http://www.wellho.net/forum/The-Tcl- ... guage/where-is-output.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
where is output

Posted by ysrise (ysrise), 18 August 2004
I wrote a very simple tcl program.

#!/usr/bin/tcl
set foo "john"
puts "Hi my name is $foo"

I run it under Windows 2000 using the command window. But there was no outputs showed on the window. It just poped out a tk window and finished.  

Does anyone know why?

Thanks a lot.

Posted by admin (Graham Ellis), 19 August 2004
Sounds like you're running under wish (i.e. tcl/tk) if a Tk window popped up.  The #! line isn't doing anything (and is misleading). Try running under Tcl rather that Tk ... if you have to run under Tk, try creating a label and packing it.  Even under Tk, something odd is going on as in wish it should stick within the main application loop.

Dunno where your output is going .... if you're running under wish and/or your program is termining early (which ity might be, but I can't tell from what information I have) there's a chance that your output is correctky routed but it's buffered by Tcl and the buffer didn't get flushed to the output before the program terminated.  

Next stage?   Have a look at the thoughts above, modify what you're doing, experiement to find which of the suggestions may or may not be correct.  

Posted by ysrise (ysrise), 19 August 2004
Thank you for replying.

I added a line code

flush stdout

after my program, still there is no output.

But I don't know how to make my program run under tcl instead of tk.
Can a tcl program run under tcl and tk at a same time?

Thank you.

Posted by admin (Graham Ellis), 19 August 2004
OK ... let's take a step back here. Do you need a GUI (Graphic User interface - buttons, text boxes, etc in their own window) or do you want to have something that's purely command line?



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho