-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexec.py
More file actions
81 lines (58 loc) · 2.55 KB
/
Copy pathexec.py
File metadata and controls
81 lines (58 loc) · 2.55 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/python2.7
#-*- coding: utf-8 -*-
from Tkinter import *
from PIL import Image, ImageTk
import tkFont, time, threading
def affichetemps():
global L
while True:
date = time.strftime('%d/%m/%y',time.localtime())
temps = time.strftime('%H:%M:%S',time.localtime())
L.config(text=date)
Te.config(text=temps)
time.sleep(0.01)
class Boutons :
def __init__(self, master):
self.Button_ON = Button(root,image=photo_ON, borderwidth=0, command=self.arret)
self.Button_ON.grid(row=0, column=0, rowspan=2, sticky=N+W, padx=10, pady=10)
self.blanco = Label(root, text="")
self.blanco.grid(row=0,column=1, padx=40)
self.tempe1 = Label(root, text="Temperature ", font=police, anchor=E)
self.tempe1.grid(row=0, column=2, padx=20, sticky=S+E)
self.tempe2 = Label(root, text="actuelle :", font=police, anchor=E)
self.tempe2.grid(row=1, column=2,padx=20, sticky=N+E)
self.tempe3 = Label(root, text="26°C", font=policeTempe)
self.tempe3.grid(row=0, column=3,rowspan=2, sticky=W+E+N+S)
self.blanco2 = Label(root, text="")
self.blanco2.grid(row=0,column=4, padx=65)
self.reglages = Button(root, text="Reglages", anchor=W, font=policeBouton, width=12)
self.reglages.grid(row=4, column=5, padx=0, sticky=E)
self.Luminosite = Button(root, text="Luminosite", anchor=W, font=policeBouton, width=12)
self.Luminosite.grid(row=3, column=5, padx=0, sticky=E)
self.Temperature = Button(root, text="Temperature", anchor=W, font=policeBouton, width=12)
self.Temperature.grid(row=2, column=5, padx=0, sticky=E)
def marche(self):
self.Button_ON = Button(root,image=photo_ON, borderwidth=0, command=self.arret)
self.Button_ON.grid(row=0, column=0, rowspan=2, sticky=N+W, padx=10, pady=10)
def arret(self):
self.Button_OFF = Button(root,image=photo_OFF, borderwidth=0, command=self.marche)
self.Button_OFF.grid(row=0, column=0, rowspan=2, sticky=N+W, padx=10, pady=10)
root = Tk()
root.geometry("800x480+0+0")
root.resizable(width=False,height=False)
police=tkFont.Font(root, size=16, family='Courier')
policeBouton=tkFont.Font(root, size=14, family='Courier')
policeTempe=tkFont.Font(root, size=26, family='Courier')
ON = Image.open("img/ON.png")
photo_ON = ImageTk.PhotoImage(ON)
OFF = Image.open("img/OFF.png")
photo_OFF = ImageTk.PhotoImage(OFF)
lol = Boutons(root)
L = Label(root, text = "", font=police)
Te = Label(root, text = "", font=police)
L.grid(row=0, column=5, sticky=S+E, padx=0)
Te.grid(row=1, column=5, sticky=N+E, padx=0)
T=threading.Thread(target=affichetemps)
T.setDaemon(True)
T.start()
root.mainloop()