From 807b1eddab506f8677824455b8fdabc5b2824861 Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Wed, 15 May 2019 09:18:22 +0200 Subject: [PATCH] gradetable py3 ready --- projects/README | 6 ++++++ projects/gradetable.py | 40 +++++++++++++++++----------------------- 2 files changed, 23 insertions(+), 23 deletions(-) mode change 100644 => 100755 projects/gradetable.py diff --git a/projects/README b/projects/README index 2ac849d..cba7a86 100644 --- a/projects/README +++ b/projects/README @@ -1,3 +1,9 @@ +All projects: + +check for time information + + + project_adaptation_fit OK, medium Add plotting of cost function diff --git a/projects/gradetable.py b/projects/gradetable.py old mode 100644 new mode 100755 index b8cf843..eee909f --- a/projects/gradetable.py +++ b/projects/gradetable.py @@ -1,26 +1,20 @@ -import os -import numpy as np -import matplotlib.pylab as plt +if __name__ == "__main__": + p100 = 33.0 # points for 100% -lecture = 'Models of Neural Systems, WS 16/17' -exam = 1 -pmax = 33 # maximum available points -p100 = 28 # points for 100% + # grades: + gradestable = [ [ 0.9, 1.0 ], [ 0.84, 1.3 ], [ 0.80, 1.7 ], [ 0.76, 2.0 ], [ 0.72, 2.3 ], + [ 0.68, 2.7 ], [ 0.64, 3.0 ], [ 0.60, 3.3 ], [ 0.56, 3.7 ], [ 0.50, 4.0 ] ] -# grades: -gradestable = [ [ 0.9, 1.0 ], [ 0.84, 1.3 ], [ 0.80, 1.7 ], [ 0.76, 2.0 ], [ 0.72, 2.3 ], - [ 0.68, 2.7 ], [ 0.64, 3.0 ], [ 0.60, 3.3 ], [ 0.56, 3.7 ], [ 0.50, 4.0 ] ] - -df = open('notentabelle.dat', 'w') -df.write('# Notentabelle\n') -print '# Notentabelle' -df.write('\n') -df.write('#Key\n') -s = '# Note\tProzent\tPunkte' -df.write(s+'\n') -print s -for f,g in gradestable : - s = ' \t%3.1f\t%5.0f\t%5.1f' % (g, 100.0*f, p100*f) + df = open('notentabelle.dat', 'w') + df.write('# Notentabelle\n') + print('# Notentabelle') + df.write('\n') + df.write('#Key\n') + s = '# Note\tProzent\tPunkte' df.write(s+'\n') - print s -df.close() + print(s) + for f,g in gradestable : + s = ' \t%3.1f\t%5.0f\t%5.0f' % (g, 100.0*f, p100*f) + df.write(s+'\n') + print(s) + df.close()