-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.py
53 lines (45 loc) · 1.11 KB
/
data.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
46
47
48
49
50
51
52
53
import util
def get_data():
with open("data.txt", "r+") as f:
read = f.read()
f.truncate(0)
f.close()
x = int(read)
file = open("data.txt", "a")
file.write(str(x + 1))
file.close()
return x
def getData_without_increase():
with open("data.txt", "r+") as f:
read = f.read()
f.truncate(0)
f.close()
x = int(read)
file = open("data.txt", "a")
file.write(str(x))
file.close()
return x
def generate_name():
with open("name.txt", "r+") as f:
f.truncate(0)
f.close()
file = open("name.txt", "a")
x = util.Upper_Lower_string(10)
file.write(x)
file.close()
return x
def setup_name():
with open("data.txt", "r+") as f:
read = f.read()
f.truncate(0)
f.close()
x = int(read)
file = open("data.txt", "a")
file.write(str(x + 1))
file.close()
return x
def return_normal():
open('data.txt', 'w').close()
file = open("data.txt", "a")
file.write(str(2))
file.close()