Код: Выделить всё
import tkinter
import random
n = 200
width = 800
height = 600
root = tkinter.Tk()
root.title("Hviezdne nebo")
canvas = tkinter.Canvas(root, width=width, height=height, bg='navy')
canvas.pack()
for _ in range(n):
x = random.randint(0, width)
y = random.randint(0, height)
font_size = random.randint(10, 20)
canvas.create_text(x, y, text='*', fill='yellow', font=('Helvetica', font_size))
root.mainloop()
Подробнее здесь: https://stackoverflow.com/questions/790 ... y-on-macos