mardi 17 mars 2020

Python program not executing

I recently started doing something random and I don't know why my program is not executing. I'm working on a Mac, and all I see when I run my code is the Python rocket icon jumping but not opening. Please help me ASAP.

This is my code:

from tkinter import *
import random

root = Tk()

root.geometry('2400x1200')
root.configure(bg='black')
char_string = '01Ń™€ßį§¶•Ľľ–≠¬§Ō∑ꮆī¨^óĻ„‚[]ąś∂ń©ķ∆Żł…嫿źć√ļńĶ≤≥÷£!@#$%^&*()_+{}:"|~<>?`'


def foo(n):

    while True:
        lst = [random.choice(char_string) for i in range(n)]
        string = ''
        for i in lst:
            string += str(i) + ' '
        myLabel = Label(root,text=string,bg='black',fg='green')
        myLabel.configure(text=string)
        myLabel.pack()



foo(40)

root.mainloop()



Aucun commentaire:

Enregistrer un commentaire