I have a file with a list of tuples like that:
(1, 4)
(230, 45), etc.
I want read the first line and take the values (x, y), and read them in my function of the program.
For example: (1, 4) # is the line 1 (x, y)
put them in the function ... #values (x, y) run them
then read the line 2 (x, y) of my file put them in the function ....#values (x, y) run it... and stop when the lenght of the file is done.
MY CODE is:
# opens file, reads contents, and splits it by newline
with open('listprueba.log', 'r') as f:
data = f.read().split('\n')
for i in range(len(data)):
int_list= [int(i) for i in data()]
x= (int (i[0]))
y=(int (i[1]))
print
and the function of the program is:
log.verbose()
env = environ()
class MyLoop(loopmodel):
# This routine picks the values to be refined
def select_loop_atoms(self):
# insertion of values x, y
return selection(self.residue_range(x, y))
What can I change in my CODE, to run it?