<commit_before>from Tkinter import *
import os

root = Tk()

#Initialising images in Array
imageNames = ["australia1.gif", "australia2.gif", "australia3.gif", "australia4.gif"]
imageArray = []
for name in imageNames:
    imageArray.append(PhotoImage(file=name))

#Initialising text files
textFileNames = ["a1.txt", "a2.txt", "a3.txt", "a4.txt"]
textArray = []
for name in textFileNames:
    with open(name) as f:
    	textArray.append(f.read())


#update image label
def get_year():
    sliderVal = slider.get()

    pic = None
    pic = imageArray[sliderVal - 1]

    myLabel.configure(image = pic)
    myLabel.image = pic

    words = textArray[sliderVal - 1]
    text.insert(INSERT, words)


#image label
pic = imageArray[0]
myLabel = Label(root, compound = CENTER, image=pic)
myLabel.pack(side="right")
#myLabel2 = Label(root, text =  )


#slider
slider = Scale(root, from_=1, to=4,tickinterval=1, length = 500, orient=HORIZONTAL)
slider.set(1)
slider.pack()


#button
B = Button(root, text='Go to', command=get_year)
B.pack()

#text
text = Text(root, font=('Arial', 32), fg = 'dark blue', padx = 6, pady = 6)
text.insert(INSERT, textArray[0])
text.pack()

root.mainloop()<commit_msg>text from file now working as expected<commit_after>from Tkinter import *
import os

root = Tk()

#Initialising images in Array
imageNames = ["australia1.gif", "australia2.gif", "australia3.gif", "australia4.gif"]
imageArray = []
for name in imageNames:
    imageArray.append(PhotoImage(file=name))

#Initialising text files
textFileNames = ["a1.txt", "a2.txt", "a3.txt", "a4.txt"]
textArray = []
for name in textFileNames:
    with open(name) as f:
    	textArray.append(f.read())


#update image label
def get_year():
    sliderVal = slider.get()

    pic = None
    pic = imageArray[sliderVal - 1]

    myLabel.configure(image = pic)
    myLabel.image = pic

    words = textArray[sliderVal - 1]
    text.delete(1.0, END)
    text.insert(INSERT, words)


#image label
pic = imageArray[0]
myLabel = Label(root, compound = CENTER, image=pic)
myLabel.pack(side="right")
#myLabel2 = Label(root, text =  )


#slider
slider = Scale(root, from_=1, to=4,tickinterval=1, length = 500, orient=HORIZONTAL)
slider.set(1)
slider.pack()


#button
B = Button(root, text='Go to', command=get_year)
B.pack()

#text
text = Text(root, font=('Arial', 32), fg = 'dark blue', padx = 6, pady = 6, wrap = 'word')
text.insert(INSERT, textArray[0])
text.pack()

root.mainloop()
{'fraction_non_alphanumeric': 0.15274365274365273, 'fraction_numerical': 0.020475020475020474, 'mean_word_length': 4.404867256637168, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1299909', 'n_tokens_mistral': 930, 'n_tokens_neox': 899, 'n_words': 223}