summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinternetlandlord <f.fredhenry@gmail.com>2022-10-17 20:38:43 +0000
committerinternetlandlord <f.fredhenry@gmail.com>2022-10-17 20:38:43 +0000
commit93ca9c5856888c373977c8901a28b432bfa17e95 (patch)
tree13a3ec7c6cf6a9cd9337bf8417dc5007a13a87de
parentce47e85fc9a958bbe872c2f58da1d5e99219e0a6 (diff)
Using tripler.py as a proof of concept for file -> list -> algo manipulation.
The test.py script is now list-generator.py for ease of reading.
-rwxr-xr-xlist-generator.py25
-rwxr-xr-xtripler.py25
2 files changed, 50 insertions, 0 deletions
diff --git a/list-generator.py b/list-generator.py
new file mode 100755
index 0000000..e44982f
--- /dev/null
+++ b/list-generator.py
@@ -0,0 +1,25 @@
+#!/bin/python3
+
+# ---------- Testing script
+# Uses command line arguments to call functions
+
+
+# ---------- Imported modules
+
+import inputoutput as io
+import csv
+import sys
+
+# ---------- Main
+
+# command line args passed to variables
+rspan = int(sys.argv[1])
+rlim = int(sys.argv[2])
+ofile =sys.argv[3]
+
+print("Your params:\n")
+print("\tCSV size: {}".format(rspan))
+print("\tNumber range: 1 - {}".format(rlim))
+print("\tOutput file: {}".format(ofile))
+print("\nGenerating a CSV!")
+io.generateCSV(rspan,rlim,ofile)
diff --git a/tripler.py b/tripler.py
new file mode 100755
index 0000000..527da24
--- /dev/null
+++ b/tripler.py
@@ -0,0 +1,25 @@
+#!/bin/python3
+
+# ---------- title
+
+
+
+# ---------- Imported modules
+import inputoutput as io
+import csv
+import sys
+
+
+# ---------- Main
+target = sys.argv[1]
+
+# ingress of data
+numdata = io.ingressCSV(target)
+
+# arithmetic operation
+for i in range(len(numdata)):
+ numdata[i] = 3 * numdata[i]
+
+# finishing up
+print("writing to file")
+io.egressCSV(numdata,target)