-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
45 lines (44 loc) · 1.33 KB
/
config.py
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
#!/usr/bin/env python
#coding: utf-8-
def get(param):
if param == "time":
config = open("./config.cfg", "r")
dtime = config.readline()
dtime = config.readline()
config.close()
heure = time.localtime(time.time())
heure = time.strftime("%H:%M", heure)
return (heure, dtime)
elif param == "quality":
config = open("./config.cfg", "r")
dtime = config.readline()
dtime = config.readline()
config.close()
elif param == "oxygen":
config = open("./config.cfg", "r")
dtime = config.readline()
dtime = config.readline()
config.close()
elif param == "pH":
config = open("./config.cfg", "r")
dtime = config.readline()
dtime = config.readline()
config.close()
elif param == "lum":
config = open("./config.cfg", "r")
dtime = config.readline()
dtime = config.readline()
config.close()
elif param == "temp":
config = open("./config.cfg", "r")
dtime = config.readline()
dtime = config.readline()
config.close()
elif param =="lang":
config = open("./config.cfg", "r")
language = config.readline()
language = config.readline()
config.close()
return language
def write(param,text):
if param ==