-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbank.py
More file actions
26 lines (21 loc) · 911 Bytes
/
bank.py
File metadata and controls
26 lines (21 loc) · 911 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
import os
def changebank(qq,choose):
check = os.getcwd()
location = os.path.abspath(os.path.join(os.path.dirname(__file__), 'bank', str(qq) + '.txt'))
if not os.path.exists(location):
with open(file=location, mode='w', encoding="utf-8") as data:
data.write("0\n")
data.close()
with open(file=location, mode='w', encoding="utf-8") as data:
data.write(str(choose) + "\n")
def checkbank(qq):
check = os.getcwd()
location = os.path.abspath(os.path.join(os.path.dirname(__file__), 'bank', str(qq) + '.txt'))
if not os.path.exists(location):
with open(file=location, mode='w', encoding="utf-8") as data:
data.write("0\n")
data.close()
with open(file=location, mode='r', encoding="utf-8") as data:
place = data.readline()
place = place.strip()
return place