@@ -0,0 +1,1986 @@
+__author__ = 'dkatz'%0A%0Afrom re import *%0Afrom xlwt import *%0A%0A%0Aclass WriteFile(object):%0A    def __init__(self, title, data_dict):%0A        self.data_dict = data_dict%0A        self.title = title%0A        self.d = %7B%7D%0A        self.wb = Workbook()%0A        self.edit_sheet = self.wb.add_sheet(%22DQ%22)%0A        self.run()%0A%0A    def ctid_finder(self, data, d):%0A        %22%22%22%0A        Finds CTID #'s by searching through the data's values using regex.%0A        :param data:%0A        :param d:%0A        :return:%0A        %22%22%22%0A        search_pattern = compile(ur%22(?:%5Cd%7B2%7D%5C/%5Cd%7B2%7D%5C/%5Cd%7B4%7D)%7C(%5Cd%7B4,%7D)%22)%0A        for key in data:%0A            print %22Wub!%22%0A            d%5Bkey%5D = findall(search_pattern, self.data_dict%5Bkey%5D)%0A%0A    def title_write(self, data):%0A        %22%22%22%0A        Writes the column heads to the excel sheet.%0A        :param data:%0A        :return:%0A        %22%22%22%0A        col = 0%0A        for key in data.keys():%0A            r = 0%0A            print %22Ping!%22%0A            print %22Col: %25d, Row: %25d%22 %25 (col, r)%0A            print key%0A            self.edit_sheet.write(r, col, key)%0A            self.data_write(col, r, key)%0A            col += 1%0A%0A    def data_write(self, col, row, k):%0A        %22%22%22%0A        Writes CTID #'s to columns beneath the appropriate column heading.%0A        :param col:%0A        :param row:%0A        :param k:%0A        :return:%0A        %22%22%22%0A        for value in self.d%5Bk%5D:%0A            try:%0A                if int(value) %3E 1:%0A                    row += 1%0A                    print %22Pong!%22%0A                    print %22Col: %25d, Row: %25d%22 %25 (col, row)%0A                    print value%0A                    self.edit_sheet.write(row, col, int(value))%0A                else:%0A                    pass%0A            except ValueError:%0A                pass%0A            else:%0A                pass%0A%0A    def run(self):%0A        %22%22%22%0A        Initializes the class methods in sequence.%0A        :return:%0A        %22%22%22%0A        self.ctid_finder(self.data_dict, self.d)%0A        self.title_write(self.d)%0A        self.wb.save(self.title)%0A%0A

Create File_Creator.py