Python Forum
Using tkinter on Windows to launch python 3 scripts
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using tkinter on Windows to launch python 3 scripts
#1
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.
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter two windows instead of one jacksfrustration 7 777 Feb-08-2024, 06:18 PM
Last Post: deanhystad
  pass a variable between tkinter and toplevel windows janeik 10 2,139 Jan-24-2024, 06:44 AM
Last Post: Liliana
  Tkinter multiple windows in the same window tomro91 1 788 Oct-30-2023, 02:59 PM
Last Post: Larz60+
  Dual Tkinter windows and shells Astrikor 6 3,832 Sep-03-2020, 10:09 PM
Last Post: Astrikor
  Tkinter scaling windows conten to or with its size not working Detzi 5 4,358 Jan-12-2020, 12:42 PM
Last Post: Detzi
  How to close one of the windows in Tkinter scratchmyhead 3 4,759 Dec-21-2019, 06:48 PM
Last Post: pashaliski
  Windows GUI with push buttons to launch python scripts drifterf 7 4,123 Jul-17-2019, 05:34 PM
Last Post: Yoriz
  [Tkinter] Using tkinter and mutiprocess ok on windows, locks up on ubuntu? ice 3 2,617 May-29-2019, 08:44 AM
Last Post: ice
  Int Variables in different Tkinter windows only returning 0 harry76 3 4,082 May-26-2019, 10:24 AM
Last Post: Yoriz
  [Tkinter] Ignore windows scaling in tkinter Gangwick 2 4,419 Jul-23-2018, 02:41 PM
Last Post: Gangwick

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020