I'm trying to read each line by line and convert each line to tuple as showing in the following exam:
Possible Duplicata: Converting String to Tuple
input_1.txt
126871 test
126262 value test
result.txt
('126871', 'test')
('126262', 'value', 'test')
Sample Code:
def string_to_tuple_example():
with open('Input_file_1.txt', 'r') as myfile1:
tuples1 = myfile2.readlines()
print tuples1 #return string, here I STUCK
Thanks a lot for any suggestion.