From fc25d4f58fcc2af37d8d3c9f4f426725030eda9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=81ysiak?= Date: Fri, 26 Apr 2019 12:42:16 +0200 Subject: [PATCH] metrics calculation --- script.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/script.py b/script.py index dd0b18d..e77e217 100644 --- a/script.py +++ b/script.py @@ -1,11 +1,14 @@ print('starting 2') -import sys -import reload +# import sys +# import reload +# +# reload(sys) +# sys.setdefaultencoding('utf8') +# +# num_lines = sum(1 for line in open('./Infra/wikiniews_results.tsv')) -reload(sys) -sys.setdefaultencoding('utf8') - -num_lines = sum(1 for line in open('./Infra/wikiniews_results.tsv')) +with open('./Infra/wikiniews_results.tsv') as f: + num_lines = (f.readlines()) print('lines number') print(num_lines)