Python Forum

Full Version: Using tkinter on Windows to launch python 3 scripts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.