469,323 Members | 1,567 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

run python from a tcl/tk GUI

Gurus;
Just wrote a front-end GUI with tcl/tk to take user input. Want to
push a button on the GUI to start running a python script. I know one
can use exec in tcl to run .exe files, but not .py or .pyc, correct?
Help on how to do this is highly appreciated.
Many thanks
Howard
Jul 18 '05 #1
2 2110
xi*********@yahoo.com (SunX) writes:
Just wrote a front-end GUI with tcl/tk to take user input. Want to
push a button on the GUI to start running a python script.
Is there a reason not to write the entire GUI in Python and use
Tkinter or wxPython?
I know one can use exec in tcl to run .exe files, but not .py or
.pyc, correct?


Sounds like a platform-specific issue; since you mention .exe files,
I assume you're running some flavor of Windows. One can certainly
run .py and .pyc files from a Tcl/Tk script on Unix-like systems.
What does your code look like?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 18 '05 #2
mf***@fuhr.org (Michael Fuhr) wrote in message news:<41********@omega.dimensional.com>...
xi*********@yahoo.com (SunX) writes:
Just wrote a front-end GUI with tcl/tk to take user input. Want to
push a button on the GUI to start running a python script.


Is there a reason not to write the entire GUI in Python and use
Tkinter or wxPython?
I know one can use exec in tcl to run .exe files, but not .py or
.pyc, correct?


Sounds like a platform-specific issue; since you mention .exe files,
I assume you're running some flavor of Windows. One can certainly
run .py and .pyc files from a Tcl/Tk script on Unix-like systems.
What does your code look like?


Sorry I forgot to mention that it was on windows. But found out that
one way to do this is "exec ~/python.exe myScript.py".
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.