from tkinter import *
root = Tk()
text = Text(root, width = 40, height = 10)
text.pack()
text.config(wrap = "word")
text.get("1.0", "end")
print (text.get("1.0", "end"))
text.get("1.0", "1.end")
print(text.get("1.0", "1.end"))
text.insert("1.0 + 2 lines", "Inserted message")
text.insert("1.0 + 2 lines lineend", "first\nfirst GUI\n...")
text.delete("1.0")
# text.delete("1.0", "3.0 lineed + 1 chars")
text.replace("1.0", "1.0 lineend", "Rafal present")
text.config(state = "disabled")
text.config(state = "normal")
text.tag_add("my_tag", "1.0", "1.0 wordend")
text.tag_configure("my_tag", background = "yellow")
text.tag_remove("my_tag", "1.1", "1.3")
print (text.tag_ranges("my_tag"))
print(text.tag_names())
print(text.tag_names("1.0"))
text.replace("my_tag.first", "my_tag.last", "ARA")
# text.tag_delete("my_tag")
print (text.mark_names())
text.insert("insert", "__")
text.mark_set("my_mark", "end")
text.mark_gravity("my_mark", "right")
text.mark_unset("my_mark")
image = PhotoImage(file = "C:/Users/rafal/Desktop/Project Fjordkraft/GUI/fjordkraft logo.gif").subsample(5, 5)
text.image_create("insert", image = image)
button = Button(text, text = "Click Me")
text.window_create("insert", window = button)


root.mainloop()