readline() method wasn't call on file object

This commit is contained in:
JLo'w 2016-02-11 19:50:19 +01:00
parent 192f6fad2e
commit 93881fd341

34
read.py
View file

@ -1,11 +1,9 @@
#Read the input file
import sys.io
def Read_input_file(file):
f = open(file, 'r')
line = readline()
line = f.readline()
info = line.split(' ')
GRILLE = (int(info[0]), int(info[1]))
@ -13,42 +11,42 @@ def Read_input_file(file):
T = int(info[3])
M = int(info[4])
line = readline()
line = f.readline()
P = int(line)
line = readline()
line = f.readline()
info = line.split(' ')
for (i in range(0, P)):
for i in range(0, P):
Pw[i] = int(info[i])
line = readline()
line = f.readline()
W = int(line)
for (i in range(0, W)):
line = readline()
for i in range(0, W):
line = f.readline()
info = line.split(' ')
Wp[i] = (int(info[0]), int(info[1]))
line = readline()
line = f.readline()
info = line.split(' ')
productQ = {}
for (j in range(1, info.size()+1):
for j in range(1, info.size())+1:
productQ[j] = int(info[j])
Wi[i] = productsQ
line = readline()
line = f.readline()
nbC = int(line)
for(i in range(0, nbC)):
line = readline()
for i in range(0, nbC):
line = f.readline()
info = line.split(' ')
Cp[i] = (int(info[0]), int(info[1]))
line = readline()
line = f.readline()
nbP = int(line)
line = readline()
line = f.readline()
info = line.split(' ')
orderQ = {}
for (j in range(0, nbP)):
for j in range(0, nbP):
orderQ[j] = int(info[j])
Ci[i] = orderQ
return
return