Пример #1
0
def read_commandline(argv: List[str]):
    neighbour_reach = 4
    if len(argv) == 3:
        file = file_funcs.open_file(argv[1], 'r')
        neighbour_reach = int(argv[2])
    elif len(argv) == 2:
        file = file_funcs.open_file(argv[1], 'r')
    else:
        print("Incorrect input format")
        exit(1)
    return (file, neighbour_reach)
Пример #2
0
def read_commandline(argv: List[str]):
    if len(argv) == 2:
        file = file_funcs.open_file(argv[1], 'r')
        return file
    else:
        print("Incorrect input format")
        exit(1)
Пример #3
0
def read_commandline(argv: List[str]):
    if len(argv) == 5:
        file = file_funcs.open_file(argv[1], 'r')
        row = int(argv[2])
        col = int(argv[3])
        radius = int(argv[4])
        return (file, row, col, radius)
    else:
        print("Incorrect input format")
        exit(1)
Пример #4
0
def main(argv: List[str]):
    input_file = read_commandline(argv)
    write_file = file_funcs.open_file('hidden.ppm', 'w')
    read_file(input_file, write_file)
    input_file.close()
    write_file.close()
Пример #5
0
def main(argv: typing.List[str]):
    arguments = commandline.process_cmdArguments(argv)
    write_file = file_funcs.open_file('image.ppm', 'w')
    cast.cast_all_rays(-10, 10, -7.5, 7.5, 512, 384, data.Point(0, 0, -14),
                       arguments[2], arguments[1], arguments[0], write_file)
    write_file.close()
Пример #6
0
def main(argv: List[str]):
    comdline_args = read_commandline(argv)
    write_file = file_funcs.open_file('fadded.ppm', 'w')
    read_file(comdline_args[0], write_file, comdline_args[1], comdline_args[2], comdline_args[3])
    comdline_args[0].close()
    write_file.close()