-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload.py
More file actions
30 lines (25 loc) · 751 Bytes
/
load.py
File metadata and controls
30 lines (25 loc) · 751 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
import os
def parser(string, pemisah):
res = []
tmp = ''
for ch in string:
if ch == pemisah:
res += [tmp]
tmp = ''
else:
tmp += ch
res += [tmp]
return res
def csv_list(filename):
raw = open(filename).read()
res = []
for el in parser(raw, '\n'):
res += [parser(el, ';')]
return res
os.chdir(os.getcwd() + r'\files')
User = csv_list('user.csv')
Gadget = csv_list('gadget.csv')
Consumable = csv_list('consumable.csv')
Consum_hist = csv_list('consumable_history.csv')
Gadget_borrow = csv_list('gadget_borrow_history.csv')
Gadget_return = csv_list('gadget_return_history.csv')