Open any file or folder using by python program

 OPEN ANY FILE OR FOLDER USING BY PYTHON PROGRAM


Create a new project and write below code into that python program after that run this program
and open any file or folder by this python program with very simply.


from tkinter import*
import os
window = Tk()
window.title("Open File")
window.geometry('350x200')
myfilePath = "E:/music/Zinda.mp3"


def clicked():

os.startfile(myfilePath)

btn = Button(window, text="Open File", command = clicked)
btn.grid(column = 5, row = 5)


window.mainloop()


Comments