예제 #1
0
 def test_example(self):
     pl = [1, 3, 4, 5, 7, 2, 8, 10, 11, 9]
     best_groups = list(Day24.valid_groups(pl, 2))
     a_best_group = best_groups[0]
     self.assertEqual(sum(a_best_group[0]), sum(a_best_group[1]))
     self.assertEqual(sum(a_best_group[0]), sum(a_best_group[2]))
     self.assertEqual(sum(a_best_group[0]), 20)
예제 #2
0
 def test_example(self):
     pl = [1,3,4,5,7,2,8,10,11,9]
     best_groups = list(Day24.valid_groups(pl, 2))
     a_best_group = best_groups[0]
     self.assertEqual(sum(a_best_group[0]), sum(a_best_group[1]))
     self.assertEqual(sum(a_best_group[0]), sum(a_best_group[2]))
     self.assertEqual(sum(a_best_group[0]), 20)
예제 #3
0
 def test_best_qe_example_4(self):
     pl = [1, 3, 4, 5, 7, 2, 8, 10, 11, 9]
     best_qe = Day24.best_qe(pl, 4)
     self.assertEqual(44, best_qe[0])
예제 #4
0
 def test_best_qe_example_4(self):
     pl = [1,3,4,5,7,2,8,10,11,9]
     best_qe = Day24.best_qe(pl, 4)
     self.assertEqual(44, best_qe[0])
예제 #5
0
'''

    Use the file Manager from Day24 and 
    write the data you read from the entries inside a text file.

    Add a field for the first name, the last name and the phone number.

    Take the code from the Day28 and add the File Manager.
    
'''

import tkinter as tk
import Day24

# initialize file manager
file_manager = Day24.FileManager('text_data', 'day_30_data.txt')
print(file_manager)

count = 0


# get entries from the text
def get_entries():

    # variable count
    global count
    count += 1

    print("\n-------- ADDING TEXT --------\n")
    file_manager.add_content_in_file("Count : {}\n\n--------\n".format(count))
    # adding random data