forked from deepmatrix/fishing_gadget
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
26 lines (21 loc) · 827 Bytes
/
Copy pathtest.py
File metadata and controls
26 lines (21 loc) · 827 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 csv
while True:
operation = raw_input("\nEnter an operation. F = add fish, L = view log, and E = end.: ")
if operation == 'F':
species = raw_input("\nWhat is the species?: ")
temp = raw_input("What is the air temperature?: ")
baro = raw_input("What is the barometric pressure?: ")
humid = raw_input("What is the humidity?: ")
appendMe = '\n'+species+','+temp+','+baro+','+humid
appendFile = open('testLog.csv', 'a')
appendFile.write(appendMe)
appendFile.close()
elif operation == 'L':
with open('testLog.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
print(row)
elif operation == 'E':
break
else:
print ('\nInvalid operation')