I want to create a little animation where text appears on an old monochrome terminal like screen as if someone is typing it. However I constantly run into problems with trying to run code after the GUI window opens up. The text is always already there when the window opens or doesnt appear at all. Any help is very appreaciated:)
string = "Hello World this is a Test String"
import random
import time
import tkinter as tk
from tkinter import *
vid = tk.Tk()
vid.title('Terminal')
text = Text( vid, width = 100, height = 50, highlightthickness=1, bg='black', highlightbackground="black", font=('Courier', 14), fg='green')
text.pack()
def main():
for i in string:
text.insert(END, i)
time.sleep(0.2)
text.after(10, main)
vid.mainloop()
This is what I came up with so far:/