I'm making a coding language in python and I want to be able to write code into a ScrolledText widget, click a save button in a menubar and then get os to write a file containing whats in the ScrolledText Widget
I've already tried multiple variations of the .get()
function (including .get('1.0', END)
but they all come back with the error AttributeError: 'NoneType' object has no attribute 'get'
from tkinter import *
import os
root = Tk()
shell = ScrolledText(root, width=167, height=42).grid(column=0, row=1)
def save():
file = open("code.txt", "x")
file.write(shell.get("1.0", END))
file.close()
I want the result to be like: file.write(shell.get(FIXED .GET CODE))