Commit bfc8320b authored by Andreas Tille's avatar Andreas Tille
Browse files

Convert remaining Python2 script

parent 6bf45d63
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -179,3 +179,41 @@ Description: Automatic port to Python3 via
         del_pos = 0
         while seq_del_cpt < (len(comment2seq[comment]) / nuc_per_del):
 
--- a/test/vde.py
+++ b/test/vde.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # -*- coding: utf-8 -*-
 
@@ -40,7 +40,7 @@ class Variant(object):
 def main():
     """ The main function of vde no argument """
 
-    enable_input = [name.split("2")[0] for name in globals().keys()
+    enable_input = [name.split("2")[0] for name in list(globals().keys())
                     if name.endswith("2eva")]
 
     parser = argparse.ArgumentParser(
@@ -89,17 +89,17 @@ def result_printing(result, count):
 
     head = ",".join(("type", "TP", "FP", "recall", "precision"))
     print(head)
-    for gap in result.keys(): 
+    for gap in list(result.keys()): 
         total = result[gap]["TP"] + result[gap]["FP"]
 
         prec = 1 if total == 0 else result[gap]["TP"]/float(total)
         recall = 1 if count[gap] == 0 else result[gap]["TP"]/float(count[gap])
 
-        print(",".join((str(gap),
+        print((",".join((str(gap),
                         str(result[gap]["TP"]),
                         str(result[gap]["FP"]),
                         str(recall),
-                        str(prec))))
+                        str(prec)))))
 
 
 def compare(exp, truth, delta):