summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinputoutput.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/inputoutput.py b/inputoutput.py
index bd38690..da22d12 100755
--- a/inputoutput.py
+++ b/inputoutput.py
@@ -19,12 +19,26 @@ def ingressCSV(location):
numlist.append(int(row[col]))
return numlist
+# ---------- CSV Egress Function
+# Takes two input arguments:
+# List to write to file (the "row")
+# Path of file to write to (location)
+#
+# No returned value(s), only closes a file
+
+def egressCSV(row,location):
+ f = open(location,'w')
+ writehead = csv.writer(f)
+
+ writehead.writerow(row)
+ f.close()
+
# ---------- CSV Generate Function
# Takes three input arguments:
# How many numbers (span)
# Range of numbers (limit)
# Path of file to write to (location)
-#
+#
# No returned function value, but random numbers
# are generated in a row and written to a CSV
@@ -39,6 +53,8 @@ def generateCSV(span,limit,location):
writehead.writerow(row)
f.close()
+# ---------- Debugging Below Here
+
# Sanity check
#print("Calling generateCSV function:\n\n")
#generateCSV(10,100,'./test.csv')
@@ -46,3 +62,6 @@ def generateCSV(span,limit,location):
#print("Calling ingressCSV function:\n")
#numdata = ingressCSV("./test.csv")
#print("Result:\n{}".format(numdata))
+
+#lateral = [8,6,7,5,3,0,9]
+#egressCSV(lateral,"./guggis.csv")