Python Forum
[Tkinter] Open a python program from a button
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Open a python program from a button
#1
I have some home-made Python programs which make html.

A simple example is insertMedia.py: it asks for the name of the media file and inserts the audio or video player html code, with the file name inserted, and appends it to my output text file, all in its own <div

This works great in tkinter, thanks to help from here. Enter the name of the file, click a button 'insert audio' or 'insert video and it's done!

What I want to have is a master window. For each "makehtml" program I will make a button. Click the button "insert media" and insertMedia.py should open and run.

I've seen code to open a new window from a window, like this:

import Tkinter as tk

def create_window():
    window = tk.Toplevel(root)

root = tk.Tk()
b = tk.Button(root, text="Create new window", command=create_window)
b.pack()

root.mainloop() 
How can I make insertMedia.py open and run from a master window? What should the command be?
Reply


Messages In This Thread
Open a python program from a button - by Pedroski55 - Jul-18-2020, 11:55 PM
RE: Open a python program from a button - by DPaul - Jul-20-2020, 03:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Creating a restart button for a Pythagorean Theorem Program pav1983 12 7,557 Apr-21-2020, 07:25 AM
Last Post: pav1983
  [PyQt] How to open a program with python without freezing LavaCreeperKing 9 8,437 Aug-17-2019, 08:48 PM
Last Post: LavaCreeperKing
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 5,141 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp
  [PyQt] Close program using Push Button with the help of input from a Message Box bhargavbn 2 6,828 Oct-30-2018, 05:09 AM
Last Post: bhargavbn

Forum Jump:

User Panel Messages

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