I need a button which the user can click which will open a textfile called "project tkinter.txt" (which is already existing).
I tried this suggestion another user had:
def opencopypaste():
from os import startfile
startfile("c:\\path\\to\\file") # i put the file path here #
openbutton = Button(frame, text='click me', command=opencopypaste)
openbutton.grid()
However, it says it cannot find "startfile" in os.py. Then I tried another suggestion which was:
def opencopypaste():
webbrowser.open("project tkinter.txt")
This time the code ran and created a button, however clicking on the button did nothing. I can't seem to find any way to create a hyperlink or button to a textfile in tkinter. Help would be much appreciated!