1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| #! /usr/bin/env python
# -*- coding: cp1252 -*-
from Tkinter import *
from random import randrange
liste1=["texte1","texte2","texte3","texte4","texte5","texte6","texte7","texte8","texte9","texte10"]
questions1=["question11","question12","question13","question14","question15"]
questions2=["question21","question22","question23","question24","question25"]
#questions3
#questions4
#.........
#......
fen1 = Tk()
fen1.configure(bg='white')
fen1.title("PIA")
larg,haut=fen1.winfo_screenwidth(),fen1.winfo_screenheight()
fen1.overrideredirect(1)
fen1.geometry("%dx%d+0+0"%(larg,haut))
cadre=Frame(fen1, bg='white',width=2000, height=2000)
cadre.place(x=160, y=120)
cadre2=Frame(fen1, bg='white',width=1000, height= 300, relief=RIDGE)
cadre2.place(x=160, y=600)
def L1():
Message(cadre, text=liste1[0], bg='white',font='Colibri 35', justify='left', width=1000).pack()
def QL11() :
for j in range(5):
a=randrange(len(questions1))
cadre2=Frame(fen1, width=2000, height=2000)
cadre2.place(x=160, y=700)
Message(cadre2, text=questions1[a], bg='white',font='Colibri 35', justify='left', width=1000).pack()
Button(fen1,text='Textes',command=L1, bg='grey').place(x=30, y=700)
Button(fen1,text='Questions',command=QL11, bg='grey').place(x=30, y=750)
Button(fen1,text='Quitter',command=fen1.destroy, bg='grey').place(x=30, y=800)
fen1.mainloop() |
Partager