Exemplo n.º 1
0
                class_tree = raw_input('Class (-1 no class): ')
                class_tree = tuple([int(e) for e in class_tree.split(',')])
            except:
                print 'N, K, K_extend, W must be integers > 0'
                continue
            print '(n, k, k_extend, w) = (%s,%s,%s,%s)' % (n, k, k_extend, w)
            sleep(2)
            Problem(n, k).calculate_tree(n, k_extend, k, w, class_tree)
        if option == 32:
            try:
                class_to_extend = raw_input('Class to extend: ')
                class_to_extend = tuple(
                    [int(e) for e in class_to_extend.split(',')])
                n_of_the_class = input('Select N: ')
                extend_from = input('Select original extended k: ')
                extend_to = input('Select K to extend: ')
            except:
                print 'N, K, K_extend, W must be integers > 0'
                continue
            Functions().calculate_extended_classes(class_to_extend,
                                                   n_of_the_class, extend_from,
                                                   extend_to, True, {}, {}, {})
        elif option == 5:
            print 'Exit'
            exit_program = True
        elif option == 400:
            print 'dropping database...'
            sleep(2)
            db = DB()
            db.drop_database()
Exemplo n.º 2
0
                k_extend = input('Select K_extend: ')
                w = input('Select W: ')
                class_tree = raw_input('Class (-1 no class): ')
                class_tree = tuple([int(e) for e in class_tree.split(',')])
            except:
                print 'N, K, K_extend, W must be integers > 0'
                continue
            print '(n, k, k_extend, w) = (%s,%s,%s,%s)' % (n, k, k_extend, w)
            sleep(2)
            Problem(n, k).calculate_tree(n,k_extend,k,w, class_tree)
        if option == 32:
            try:
                class_to_extend = raw_input('Class to extend: ')
                class_to_extend = tuple([int(e) for e in class_to_extend.split(',')])
                n_of_the_class = input('Select N: ')
                extend_from = input('Select original extended k: ')
                extend_to = input('Select K to extend: ')
            except:
                print 'N, K, K_extend, W must be integers > 0'
                continue
            Functions().calculate_extended_classes(class_to_extend, n_of_the_class, extend_from, extend_to, True, {}, {}, {})
        elif option == 5:
            print 'Exit'
            exit_program = True
        elif option == 400:
            print 'dropping database...'
            sleep(2)
            db = DB()
            db.drop_database()