myslim ze geon spominal ten graf k prvocislam
tento kod vykresli kazd 1000ku cisel do noveho riadku, ako bodky, a vidiet ze niesu az tak neusporiadane usporiadane :-P
from Tkinter import *
okno=Tk()
cvs=Canvas(okno, height=20, width=1000)
cvs.grid(row=0, column=0, sticky=W+E+N+S)
def prvocislo(cislo):
if cislo==2 or cislo==1:
y=0
else:
y=0
for x in range ((cislo/2)+1):
if x>1:
if cislo%x ==0:
y=1
if y==0:
if i<1000:
cvs.create_line(i, 1, i, 2)
if i<2000 and i>1000:
cvs.create_line(i-1000, 3, i-1000, 4)
if i<3000 and i>2000:
cvs.create_line(i-2000, 5, i-2000, 6)
if i<4000 and i>3000:
cvs.create_line(i-3000, 7, i-3000, 8)
if i<5000 and i>4000:
cvs.create_line(i-4000, 9, i-4000, 10)
if i<6000 and i>5000:
cvs.create_line(i-5000, 11, i-5000, 12)
if i<7000 and i>6000:
cvs.create_line(i-6000, 13, i-6000, 14)
if i<8000 and i>7000:
cvs.create_line(i-7000, 15, i-7000, 16)
if i<9000 and i>8000:
cvs.create_line(i-8000, 17, i-8000, 18)
if i<10000 and i>9000:
cvs.create_line(i-9000, 19, i-9000, 20)
for i in range (10000):
prvocislo(i)
mainloop()
co vy na to? =)