cis: bug fixes
[living-lab-site.git] / cis / eval / calc.py
diff --git a/cis/eval/calc.py b/cis/eval/calc.py
new file mode 100644 (file)
index 0000000..d154dc2
--- /dev/null
@@ -0,0 +1,17 @@
+import sys
+
+if __name__ == '__main__':
+    input_file = open(sys.argv[1], 'r')
+
+    s = 0.0
+    c = 0
+    while True:
+        line = input_file.readline()
+        if line == '':
+            break
+
+        s += float(line)
+        c += 1
+
+    print "sum =", s
+    print "avg =", (s/c)