Python Forum
Using tkinter on Windows to launch python 3 scripts - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: Using tkinter on Windows to launch python 3 scripts (/thread-19842.html)



Using tkinter on Windows to launch python 3 scripts - Mocap - Jul-17-2019

I'm trying to use tkinter to create a button that launches the relevant python script. I've never done this before and I saw someone else asking it, but without specifying which GUI he was using. So I just need some basic help with tkinter. I'm pretty good with it, I just don't know how to "connect" it with a separate Python script.


RE: Using tkinter on Windows to launch python 3 scripts - Yoriz - Jul-17-2019

Try to do the following.
  1. Create a Frame and a mainloop, test it works.
  2. Add a button to the frame, test it works.
  3. Add an event to the button, begin with a print to test it works.
  4. Add the call to the separate python script to the buttons event (depends what the script does how you go about this).

Give this a go, when you get stuck, please post a minimal code sample (in python code tags) for the specific part your stuck on, explain what you expect to happen and what is actually happening and any errors received in error tags.