f



How to execute script using tcl interpreter coming with Python in Windows?

Hello!

Almost each Python installation in Windows has it's own tcl interpreter. 

Can I execute a tcl script without additional tcl installation? I didn't find any executable tcl file, there is no files contain words wish or tclsh. 

There are several interesting *.dll files:
/c/Python27/ArcGIS10.1/DLLs/tcl85.dll
/c/Python27/ArcGIS10.1/DLLs/tclpip85.dll
/c/Python27/ArcGIS10.1/DLLs/tk85.dll

Here is example of content of Python's tcl directory http://pastebin.com/ts8PmAR4  


Thank you
0
John
3/17/2015 9:11:01 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

3 Replies
531 Views

Similar Articles

[PageSpeed] 14

El martes, 17 de marzo de 2015, 18:11:04 (UTC-3), John Johnson escribi=F3:
> Hello!
>=20
> Almost each Python installation in Windows has it's own tcl interpreter.=
=20
>=20
> Can I execute a tcl script without additional tcl installation? I didn't =
find any executable tcl file, there is no files contain words wish or tclsh=
..=20

You can create a Tcl interpreter from tkinter and use the eval() method.
Here is a simple python wrapper (python3, adjust for your py version):

""" Simple Tcl wrapper example """
import tkinter

# read the file
fd=3Dopen("filename.tcl")
script=3Dfd.read()
fd.close()

# create the Tcl interpreter
tcl=3Dtkinter.Tcl()

# run the script
tcl.eval(script)


>=20
> There are several interesting *.dll files:
> /c/Python27/ArcGIS10.1/DLLs/tcl85.dll
> /c/Python27/ArcGIS10.1/DLLs/tclpip85.dll
> /c/Python27/ArcGIS10.1/DLLs/tk85.dll
>=20
> Here is example of content of Python's tcl directory http://pastebin.com/=
ts8PmAR4 =20

note however that Tcl as shipped with python is somewhat crippled; it misse=
s
some packages, notably the ones provided as modules on current Tcl versions
(msgcat, http, among others)

Regards
Emiliano
0
Emiliano
3/18/2015 12:41:45 AM
Am 17.03.15 um 22:11 schrieb John Johnson:
> Almost each Python installation in Windows has it's own tcl interpreter. 
> 
> Can I execute a tcl script without additional tcl installation? 
> I didn't find any executable tcl file, there is no files contain words wish or tclsh. 

The tclsh or wish binary usually is just a very small program which
calls out into tcl.dll. You can do the same as explained by Emiliano.

If you want to avoid an installation, maybe your problems are better
solved with a tclkit? That is a single-file executable containing a Tcl
interpreter, Tk is often included and some come with a bunch of
packages. For instance, here:

http://sourceforge.net/projects/kbskit/files/kbs/0.4.6/

you'll find many prebuilt tclkits. This one is Tcl only on Windows:

http://sourceforge.net/projects/kbskit/files/kbs/0.4.6/WindowsNT_kbsvq8.6-cli.exe/download

It is very compact with only 3.6MB in size. With some tricks, tclkits of
~1MB are possible.

This one is with Tk:

http://sourceforge.net/projects/kbskit/files/kbs/0.4.6/WindowsNT_kbsvq8.6-gui.exe/download

and this one contains a large number of packages:

http://sourceforge.net/projects/kbskit/files/kbs/0.4.6/WindowsNT_kbsvq8.6-bi.exe/download

Roy Keene runs a web service, where you can build your own tclkit
including some packages:

http://kitcreator.rkeene.org/kitcreator

	Christian


0
Christian
3/18/2015 1:01:01 AM
=D1=81=D1=80=D0=B5=D0=B4=D0=B0, 18 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2015 =D0=
=B3., 8:30:24 UTC+2 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=
=D0=B5=D0=BB=D1=8C Christian Gollwitzer =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=
=B0=D0=BB:
> Am 17.03.15 um 22:11 schrieb John Johnson:
> > Almost each Python installation in Windows has it's own tcl interpreter=
..=20
> >=20
> > Can I execute a tcl script without additional tcl installation?=20
> > I didn't find any executable tcl file, there is no files contain words =
wish or tclsh.=20
>=20
> The tclsh or wish binary usually is just a very small program which
> calls out into tcl.dll. You can do the same as explained by Emiliano.
>=20
> If you want to avoid an installation, maybe your problems are better
> solved with a tclkit? That is a single-file executable containing a Tcl
> interpreter, Tk is often included and some come with a bunch of
> packages. For instance, here:
>=20
> http://sourceforge.net/projects/kbskit/files/kbs/0.4.6/
>=20
> you'll find many prebuilt tclkits. This one is Tcl only on Windows:
>=20
> http://sourceforge.net/projects/kbskit/files/kbs/0.4.6/WindowsNT_kbsvq8.6=
-cli.exe/download
>=20
> It is very compact with only 3.6MB in size. With some tricks, tclkits of
> ~1MB are possible.
>=20
> This one is with Tk:
>=20
> http://sourceforge.net/projects/kbskit/files/kbs/0.4.6/WindowsNT_kbsvq8.6=
-gui.exe/download
>=20
> and this one contains a large number of packages:
>=20
> http://sourceforge.net/projects/kbskit/files/kbs/0.4.6/WindowsNT_kbsvq8.6=
-bi.exe/download
>=20
> Roy Keene runs a web service, where you can build your own tclkit
> including some packages:
>=20
> http://kitcreator.rkeene.org/kitcreator
>=20
> 	Christian

Thank you, nice to see so many possibilities
0
John
3/18/2015 6:59:58 AM
Reply:

Similar Artilces:

Why can execution results in tcl shell differ than if using tcl script??
Hi, I have been posting a thread here: http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/983d7ef3e4b1ab54# I have another question that might be related to it, I'm doing set of tcl commands (involving external shell commands execution) one time in tcl shell, and the other from a tcl script.. Although both command sequences are the same, I get quite different results!!! Why did this happens?? Thanks, Ahmad Ahmad wrote: > Hi, > > I have been posting a thread here: > http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/983d7ef3e4b1ab54# > >...

l'C program executing from a tcl script with pipe opened using open command in Tcl
Hi all, I wanted to communicate with a C program from a Tcl script.. The test code i have written is below Both the 'C' program and Tcl script are located in the same directory. The 'C' program is below. I have named it CTCL.C #include<stdio.h> #include<string.h> int main() { int i; char c[30]; printf("Reading..."); scanf("%s",c); printf("String read is :%s\n",c); fflush(stdout); return 0; } I have compiled the program with the command cc CTCL.C -o ctcl So the executable was generated with the name 'ctcl' The Tcl script...

Possible bug in Tcl or Windows or Tcl on Windows
Hi, There seems to be a bug in the way numbers are compared in Tcl. Consider the below script for calculating Pythagorean triplets. For hypotenuse upto a value of 100, there should have been 63 unique triplets. On Windows XP the script detects only 62. The script doesn't detect the case where c=99, b=20 ==> a=101. However running the same script under Tcl 8.4.1 in Cygwin detects 63 triplets. I don't have a Linux machine at hand to test it there. Following is the script and relevant output. Could anyone shed some light on the cause of this. Maybe it has something to do with how ...

Tcl/Tk scripts to windows executable
Dear All, I am writing Tcl/TK based GUI aplication and I am using packages like Iwidgets 4.0.2 in the scripts. When I am wrapping these scripts to Exe using Freewrap application, it is giving error. After refering some of the documents I have included lappend auto_path /tcl/lib/iwidgets4.0.2 in the script file. But it is giving the error as "can't find package Itcl 3.2" and so on. Can anyone guide me how to wrap all the scripts to EXE which are using Iwidgets packages also? Thanks, Muthu Muthu wrote: > Dear All, > > I am writing Tcl/TK based GUI aplication and I a...

[Windows] executing a configure script from a tcl scrip
Hi folks, I am using tcl to manage the building of the (many) projects that are involved in my application. Some of these projects are based on GNU autoconf / automake tools. I am having problem to launch the configure script from tcl. I lanch tclsh85 from msys, from the directory where the configure script is. Executing : % exec configure Produces the error : couldn't execute "configure": no such file or directory The best I found is something : % exec sh -c "configure --with-tcl=e:/developpement/Tcl/lib" >@ stdout 2>@1 However : 1 - since the script is ...

Script to convert Tcl scripts to Python?
Hi, I have a 10k+ line Tcl program that I would like to auto convert over to Python. Do any scripts exist that can convert ~90% of the standard Tcl syntax over to Python? I know Python doesn't handle strings, but just for general syntax e.g., puts > print, expr > math operations thanks On Apr 23, 9:17 am, "Achillez" <n...@na.com> wrote: > Hi, > > I have a 10k+ line Tcl program that I would like to auto convert over to > Python. Do any scripts exist that can convert ~90% of the standard Tcl > syntax over to Python? I know Python doesn't hand...

Tclsh application error (executable from tcl script using freewrapTCLSH62
Hi, I used freewrapTCLSH62 to create an executable for a tcl script that telnets into a computer and reboots it and logs into it again after it restarts. When I run the application everything runs fine right until the target system restarts, when I get a pop-up window saying - Tclsh Application has encountered a problem and needs to close. The executable stops right there. Below is the file that was included in the error report. <?xml version=3D"1.0" encoding=3D"UTF-16"?> <DATABASE> <EXE NAME=3D"mfg.exe" FILTER=3D"GRABMI_FILTER_PRIVA...

Passing arguments to & executing, a python script on a remote machine from a python script on local machine (using ssh ?)
Hi c.l.p folks Here is my situation 1. I have two machines. Lets call them 'local' & 'remote'. Both run ubuntu & both have python installed 2. I have a python script, local.py, running on 'local' which needs to pass= arguments ( 3/4 string arguments, containing whitespaces like spaces, etc = ) to a python script, remote.py running on 'remote' (the remote machine). I have the following questions: 1. What's the best way to accomplish my task ? I have researched quite a bit & pretty much everybody is using ssh. After googling a ...

How will I execute an expect script from a tcl script?
I have tried to execute an expect script from a tcl script. But I am unable to do that. I have used following options: one is exec {expect myexpect.exp} another one is source myexpect.exp only "expect myexpect.exp" is running properly. But while trying execute in both ways from tcl script the tcl script is not responding. Please help me to solve this problem. On Jun 7, 7:05 am, manasi.bis...@gmail.com wrote: > I have tried to execute an expect script from a tcl script. But I am > unable to do that. > > I have used following options: > one is > exec {expect my...

Using "Open with" in windows to process a file with a tcl/tk scripts?
I have the following problem in windows 2000. I have written a TCL/TK script which process xml files. Now I will like to be able select the xml file using the windows file manager and use "open with" to startup the tcl/tk scripts and pass the xml file as argument. When I do this now I get an error telling that the xml file is not a valid win32 application. Any ideas of how to do this? Thanks in advance Hello, You should enter something similar to: c:\path\to\wish.exe "C:\path\to\xmleditor.tcl" "%1" Regards, -- Ramon Rib´┐Ż http://gatxan.cimne.u...

Tcl command to evaluate a tcl script?
Hi all, I need to evaluate a separate tcl file within a tcl file. Is there any tcl command to evaluate a tcl file ? Regards, Prabu.K prabu wrote: > Hi all, > > I need to evaluate a separate tcl file within a tcl file. Is there any > tcl command to evaluate a tcl file ? > > Regards, > Prabu.K > hi, try: source your_other_tcl_file.tcl cheers, Tobi ...

Executing Python Scripts on Mac using Python Launcher
Hello, This is my first post so go easy on me. I am just beginning to program usi= ng Python on Mac. When I try to execute a file using Python Launcher my co= de seems to cause an error in terminal, when I execute the exact same piece= of code and run it in windows it seems to execute as exactly intended. How can I make my python script to open up correctly using Python Launcher= ? I am running 10.7 on my Mac. I would upload a photo with the error I ge= t but I can't seem to find the upload feature in this group. Thanks On Mon, Jun 25, 2012 at 11:19 AM, David Thomas <d...

interpreter using Tcl
I am looking to create a interpreter that supports basic commands, control flow such as if-else, loops, fucntion calls for a serial communication application, I am not sure what the best language would be for this kind of problem, I only that tcl is a very good interpreted language and am not sure how it could it be used for the same, If anybody can point me to the right direction, the right programming language and any examples available..that will be great.. Thanks in advance.. yadurajj@yahoo.com wrote: > I am looking to create a interpreter that supports basic commands, > control f...

Executing a python script with arguments from a python script
Hi, I need to call a python script, with command line arguments (it is an autonomous script with a __main__), from within another python script. Can I use exec() or execfile() for this? How to pass the arguments? Thanks, Olivier. olaufr@gmail.com wrote: > Hi, > > I need to call a python script, with command line arguments (it is an > autonomous script with a __main__), from within another python script. > Can I use exec() or execfile() for this? How to pass the arguments? > > Thanks, > > Olivier. > Obligatory "ugh." Are you sure you want to do...

Web resources about - How to execute script using tcl interpreter coming with Python in Windows? - comp.lang.tcl

The Interpreter - Wikipedia, the free encyclopedia
The Interpreter is a 2005 political thriller film starring Nicole Kidman , Sean Penn , and Catherine Keener . It was the final film to be directed ...

The Interpreter (@Interpreter_Mag) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Contract Interpreter Information Center
... contractors across the nation who represent the backbone of the Language Services Industry. Popular Welcome to the official Contract Interpreter ...

Travel Interpreter - Multilingual Phrasebook on the App Store on iTunes
Get Travel Interpreter - Multilingual Phrasebook on the App Store. See screenshots and ratings, and read customer reviews.

Mandela's sign language interpreter's return to fame: Livelens - YouTube
Meet the infamous sign language interpreter at Nelson Mandela's memorial in his first commercial for the livelens app. Make your first live video ...

Swedish sign-language interpreter steals the show from Eurovision hopefuls
A Swedish sign-language interpreter whose emotional and at times salacious interpretation of a pop performance has stolen the show at the Scandinavian ...

Killing sparks fears for safety of 600 Afghan interpreters
An Afghan interpreter who worked for the Australian army in Afghanistan has been killed in a suspected Taliban revenge attack while he waited ...

All signs suggest Obama's interpreter for the deaf was fake
The international deaf community is up in arms as claims emerged the signed-language interpreter on stage at Nelson Mandela's memorial service ...

Eurovision 2015: Interpreter Tommy Krangh steals spotlight in hilarious fashion
If Guy Sebastian was facing this guy at Eurovision in Vienna in May, we'd be saying, sorry Guy, but don't even bother getting on the plane.

All signs suggest Obama's interpreter for the deaf was fake
The international deaf community is up in arms as claims emerged the signed-language interpreter on stage at Nelson Mandela's memorial service ...

Resources last updated: 1/25/2016 9:14:18 PM