run python from a tcl/tk GUI

S

SunX

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
 
M

Michael Fuhr

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?
 
S

SunX

Is there a reason not to write the entire GUI in Python and use
Tkinter or wxPython?


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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top