forked from exo7math/python1-exo7
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarkdown_code_1_1.py
More file actions
31 lines (24 loc) · 912 Bytes
/
markdown_code_1_1.py
File metadata and controls
31 lines (24 loc) · 912 Bytes
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
from tkinter import *
from tkinter.font import Font
# Fenêtre tkinter
root = Tk()
canvas = Canvas(root, width=800, height=600, background="white")
canvas.pack(fill="both", expand=True)
# Format de la page de texte
largeur = 700
hauteur = 500
# Couleurs
couleur_fond = "lightgray"
couleur_texte = "black"
# Cadre
canvas.create_rectangle(10,10,largeur,hauteur,width=2,fill=couleur_fond)
# Fontes
fonte_texte = Font(family="Times", size=12)
fonte_italique = Font(family="Times", slant="italic", size=12)
fonte_gras = Font(family="Times", weight="bold", size=12)
fonte_titre = Font(family="Times", weight="bold", size=20)
fonte_sous_titre = Font(family="Times", weight="bold", size=16)
# Test
canvas.create_text(100,100, text="Vive les maths !",anchor=NW,font=fonte_titre,fill=couleur_texte)
canvas.create_text(200,200, text="Vive Python !",anchor=NW,font=fonte_sous_titre,fill="red")
root.mainloop()