def main():
    """The main driver function of our Phonebook."""

    # Load existing data into phonebook
    load_phonebook()

    print("\n!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!")
    print("Welcome to the fanciest Phonebook EVER!\n")
    # initialize option variable
    option = ""

    while option != "E":
        # Ask the user what they want to do
        option = input(
            "You have the power to: \n\t(A)dd contacts \n\t(D)elete contacts \n\t(P)rint your Phonebook \n\t(S)earch \n\t(E)xit. \nWhich would you like to do? "
        )

        if option.upper() == "A":
            name = input("\nWhat is the name of your contact? ")
            number = input("\nWhat is " + name + "'s number? ")
            add_contact(name, number)
        elif option.upper() == "D":
            name = input("\nWhat contact are you removing? ")
            delete_contact(name)
        elif option.upper() == "P":
            print_phonebook()
        elif option.upper() == "S":
            search_term = input("\nDo you want to search by (N)ame or by (Ph)one Number? ")
            search_phonebook(search_term)
        elif option.upper() == "E":
            exit_phonebook()
        else:
            print("\nI'm sorry that is not an acceptable option. ")
Example #2
1
def enter_dynamic_data():
    lang = input("What language? ")
    version = input("What versiont? ")
    skill = input("What sill level? ")

    c.execute("INSERT INTO example(Language, Version, Skill) VALUES(?, ?, ?)", (lang, version, skill))
    conn.commit()
 def pickup(self, item):
     if item.lower() == "all":
         conf = input("Do you want to pick up all of the items in this room: ")
         if conf.lower() == "y" or conf.lower() == "yes":
             for item in room[self.room_number]["items"]:
                 try:
                     self.inventory[item] = room[self.room_number]["items"][item]
                     del room[self.room_number]["items"][item]
                 except KeyError:
                     print("You look everywhere but can't find anything to pick up.")
     elif item.lower() == "gold":
         conf = input("Do you want to pick up the coins on the floor: ")
         if conf.lower() == "y" or conf.lower() == "yes":
             try:
                 self.gold += room[self.room_number]["gold"]
                 room[self.room_number]["gold"] -= room[self.room_number]["gold"]
             except KeyError:
                 if self.room["environment"] == "Temple":
                     print("You look carefully around the gleaming marble room,", end="")
                     print("thoroughly checking every corner, but fail to find any coins.")
                 else:
                     print("You look everwhere but fail to find any coins (environment not defined)")
     else:
         conf = input("Do you want to pick up the " + item.lower() + ": ")
         if conf.lower() == "y" or conf.lower() == "yes":
             try:
                 self.inventory[item] = room[self.room_number]["items"][item]
                 del room[self.room_number]["items"][item]
             except KeyError:
                 print("You look everywhere but can't find a " + item.lower())
         else:
             print("You consider it, but decide not to pick up the " + item.lower())
def sqmat():
    """
    computes Squared values of each element in the matrix
    """
    test = input()
    for idx in range(test):
        matdim = input()
        maxsize = [0 for _ in range(matdim)]
        matrix = []
        for _ in range(matdim):
            mat = map(int, raw_input().split())
            assert len(mat) == matdim
            mat = map(square, mat)
            pos = 0
            for num in mat:
                length = len(str(num))
                if maxsize[pos] < length:
                    maxsize[pos] = length
                pos += 1
            matrix.append(mat)
        print "Quadrado da matriz #%i:" % (idx + 4)
        start = 0
        for opmat in matrix:
            pos = 0
            for val in opmat:
                print "{0:>{1}}".format(val, maxsize[pos]),
                pos += 1
            if start < matdim - 1:
                print ""
            start += 1
        print "\n"
Example #5
1
def computer_turn():
    print("\n\n===============\nCOMPUTER'S TURN\n===============")
    valid = False
    while valid == False:
        row = random.randint(0, 7)
        column = random.randint(0, 7)
        cell = pgrid[row][column]
        if cell == "X":
            continue
        valid = True
    pgrid[row][column] = "X"
    print("Computer targets row {0}, column {1}.".format(row, column))
    p(pgrid)
    if cell != 0:
        print("Hit! (ship {0})".format(cell))
        pshipcount[cell] -= 1
        if pshipcount[cell] == 0:
            print("The computer sunk your ship {0}.\n".format(cell))
            pshipcount[cell] == "X"
        pshipcount[0] -= 1
    else:
        print("Miss.")
    if pshipcount[0] == 0:
        print("\n******You have lost.******")
    else:
        input("Press <Enter> to continue.")
Example #6
1
def gen_redshift_query():

    # `raw_input` is input in Python 3
    if sys.version_info.major == 2:
        input = raw_input

    aws_access_key_id = os.getenv("AWS_ACCESS_KEY_ID") or input("AWS_ACCESS_KEY: ")
    aws_secret_access_key = os.getenv("AWS_SECRET_ACCESS_KEY") or input("AWS_SECRET_ACCESS_KEY")

    s3_bucket = input("S3 Output Bucket: ")
    output_table = input("Output Redshift Table: ")

    upload = """
        COPY           \'cc.{output_table}\'
        FROM           \'{s3_bucket}\'
        CREDENTIALS    \'aws_access_key_id={aws_access_key_id};aws_secret_access_key={aws_secret_access_key};\'
        DELIMITER      \'\\t\'
        REGION         \'us-east-1\'
        ACCEPTINVCHARS  AS \'^\'
        NULL            AS \'\\000\'
        TRUNCATECOLUMNS REMOVEQUOTES;
        """.format(
        aws_access_key_id=aws_access_key_id,
        aws_secret_access_key=aws_secret_access_key,
        s3_bucket=s3_bucket,
        output_table=output_table,
    )
    return upload
Example #7
0
def play():
    Board = TicTacToeBoard()
    humanval = "X"
    cpuval = "O"
    Board.PrintBoard()

    while Board.full_board() == False and Board.winner() == "N":
        print("your move, pick a row (0-2)")
        row = int(input())
        print("your move, pick a col (0-2)")
        col = int(input())

        if Board.get_square(col, row) != "N":
            print("square already taken!")
            continue
        else:
            Board.play_square(col, row, humanval)
            if Board.full_board() or Board.winner() != "N":
                break
            else:
                Board.PrintBoard()
                print("CPU Move")
                make_simple_cpu_move(Board, cpuval)
                Board.PrintBoard()

    Board.PrintBoard()
    if Board.winner() == "N":
        print("Cat game")
    elif Board.winner() == humanval:
        print("You Win!")
    elif Board.winner() == cpuval:
        print("CPU Wins!")
def main():
    note = []
    fname = "notebook.dat"
    note = readfile(fname)
    while True:
        userchoice = input(
            """(1) Read the notebook
(2) Add note
(3) Edit a note
(4) Delete a note
(5) Save and quit
Please select one: """
        )
        if userchoice == "1":
            for i in note:
                print(i)
        elif userchoice == "2":
            newNote = input("Write a new note: ")
            newNote = newNote + ":::"
            newNote += time.strftime("%X %x")
            note.append(newNote)
        elif userchoice == "3":
            note = editnote(note)
        elif userchoice == "4":
            note = deletenote(note)
        elif userchoice == "5":
            writefile(note, fname)
            print("Notebook shutting down, thank you.")
            break
Example #9
0
def is_triangle_usr_input():

    a = input('Enter the length of the first side "a": ')
    b = input('Enter the length of the second side "b": ')
    c = input('Enter the length of the third side "c": ')

    is_triangle(a, b, c)
def main() -> int:
    n = int(input())
    numbers = [int(word) for word in input().split()]
    results = [str(bit_count(number)) for number in numbers]

    print(" ".join(results))
    return 0
Example #11
0
def set_up_queue(queue_name):
    account_name = input("Please provide Azure account name:")
    account_key = input("Please provide Azure access key:")

    queue_service = QueueService(account_name, account_key)

    print("Creating queue: {} ...".format(queue_name))

    try:
        queue_service.create_queue(queue_name)
    except AzureException as exc:
        print("Cannot create queue, reason: {}".format(exc), file=sys.stderr)
        sys.exit(1)
    else:
        print("Queue successfully created.")

    print("Generating SAS token...")

    expiry_date = datetime.date.today() + datetime.timedelta(days=30)

    print("SAS token will expire in", str(expiry_date))

    access_policy = AccessPolicy(
        expiry=str(expiry_date),
        permission=(
            QueueSharedAccessPermissions.READ + QueueSharedAccessPermissions.ADD + QueueSharedAccessPermissions.PROCESS
        ),
    )

    sas_token = queue_service.generate_shared_access_signature(queue_name, SharedAccessPolicy(access_policy))

    print("Generated SAS token:", sas_token)
    print("Please use above token in QueueManager.")
def menu():
    print("PROBLEMAS SOCIALES.")
    print()
    print("AREQUIPA - BULLING")
    print("PUNO - POBREZA")
    print("CUZCO - CONTAMINACION")
    print()
    n=str(input("Ingrese su nombre: "))
    d=str(input("Ingrese su Departamento: "))
    print()
    d=d.lower()

    if d=='arequipa':
        print("SR. ",n," EL PROBLEMA SOCIAL QUE ACTUALMENTE ENFRENTA AREQUIPA ES EL BULLING")
        time.sleep(2)
    elif d=='puno':
        print("SR. ",n," EL PROBLEMA SOCIAL QUE ACTUALMENTE ENFRENTA PUNO ES LA POBREZA")
        time.sleep(2)
    elif d=='cuzco':
        print("SR. ",n," EL PROBLEMA SOCIAL QUE ACTUALMENTE ENFRENTA CUZCO ES LA CONTAMINACION")
        time.sleep(2)
    else:
        print("SR. ",n," DEPARTAMENTO NO ENCONTRADO EN NUESTRA BASE DE DATOS")
        print("VUELVA A INTENTAR")
        time.sleep(2)
        os.system("clear")
        menu()
Example #13
0
 def _display(self, contentType):
     # print depending on the content type
     while True:
         try:
             if isinstance(contentType, InputText):
                 contentType.run_callback(result=rlinput(contentType.content, contentType.default_input))
             elif isinstance(contentType, LicenseAgreement):
                 print(contentType.content)
                 contentType.choose(answer=input(contentType.input))
             elif isinstance(contentType, TextWithChoices):
                 contentType.choose(answer=input(contentType.prompt))
             elif isinstance(contentType, DisplayMessage):
                 print(contentType.text)
             elif isinstance(contentType, UnknownProgress):
                 if not contentType.bar:
                     contentType.bar = ProgressBar(widgets=[BouncingBar()])
                 with suppress(StopIteration):
                     # pulse and add a timeout callback
                     contentType.bar(contentType._iterator()).next()
                     UI.delayed_display(contentType)
                 # don't recall the callback
                 return False
             else:
                 logger.error("Unexcepted content type to display to CLI UI: {}".format(contentType))
                 MainLoop().quit(status_code=1)
             break
         except InputError as e:
             logger.error(str(e))
             continue
Example #14
0
def show4bar():
    """
    Plots a 4-bar design, for the five precision points
    on a straight line, with coordinates taken from Problem 7
    of the Morgan-Wampler paper.
    """
    pt0 = (0.50, 1.06)
    pt1 = (-0.83, -0.27)
    pt2 = (-0.34, 0.22)
    pt3 = (-0.13, 0.43)
    pt4 = (0.22, 0.78)
    points = [pt0, pt1, pt2, pt3, pt4]
    ags = [1.44734213756, 0.928413708131, 0.751699211109, 0.387116282208]
    x = (-0.0877960434509, -0.851386907516)
    y = (0.235837391307, -1.41899202704)
    fig = plt.figure()
    plotbar(fig, points, -1, x, y)
    plotbar(fig, points, 0, x, y)
    rx1, ry1 = rotate(x, y, ags[0])
    plotbar(fig, points, 1, rx1, ry1)
    rx2, ry2 = rotate(x, y, ags[1])
    plotbar(fig, points, 2, rx2, ry2)
    rx3, ry3 = rotate(x, y, ags[2])
    plotbar(fig, points, 3, rx3, ry3)
    rx4, ry4 = rotate(x, y, ags[3])
    plotbar(fig, points, 4, rx4, ry4)
    fig.show()
    input("hit enter to continue")
Example #15
0
def main():  # Main
    createListFromFile()
    choice = None
    while choice != "Q":  # So porgram can quit
        choice = printMenu()

        if choice.upper() == "L":  # Lists all books in list
            print("\n")
            listAll()
            print("\n")

        elif choice.upper() == "A":  # Adds book
            print("\n")
            bookName = input("Enter a name of a book: ")
            print(addBook(listOfBooks, bookName))
            print("\n")

        elif choice.upper() == "N":  # Prints number of books
            print("\n")
            print(numberOfBooks(listOfBooks))
            print("\n")

        elif choice.upper() == "R":  # Prints out a random book
            print("\n")
            print(randomBook(listOfBooks))
            print("\n")

        elif choice.upper() == "B":  # B for Bonus
            print("\n")
            stringThing = input("Enter your list of books separated by a comma: ")  # I did it
            print(batchAdd(listOfBooks, stringThing))  # This is the thing that i did to do it
Example #16
0
def facebook(kjonn):
    if kjonn == "m":
        print("Mellom 40-45% av Facebook sine brukere er menn.")
        return str(input("Er du en av disse? "))
    else:
        print("Mellom 55-60% av Facebook sine brukere er kvinner.")
        return str(input("Er du en av disse? "))
def main():
    n = int(input())
    drifts = dict()
    for _ in range(n):
        i, j = map(int, input().split())
        drifts[i] = drifts.get(i, set()) | set([j])
    drifts = [drifts[k] for k in drifts]
    groups = []

    i = 0
    group = set()
    while i < len(drifts):
        if not group:
            group |= drifts[i]
        j = i + 1
        modified = False
        while j < len(drifts):
            if group & drifts[j]:
                group |= drifts.pop(j)
                modified = True
                break
            j += 1
        if not modified:
            i += 1
            groups.append(group)
            group = set()

    print(len(groups) - 1)
Example #18
0
def start():
    """

    """
    custom = input("Custom net: y/n ")
    ann_type = input("Options: sigmoid, rlu, ht: ")
    print("---------")
    if custom == "N" or custom == "n":
        image_recog = ANN(ann_type)
        image_recog.preprosessing(image_recog.images)
    else:
        layerlist = input("Enter layer list: ")
        layerlist = layerlist.split()
        for x in range(len(layerlist)):
            layerlist[x] = int(layerlist[x])
        image_recog = ANN(custom=True, layer_list=layerlist, ann_type=ann_type)
        image_recog.preprosessing(image_recog.images)

    errors = []
    print("Successfully loaded the images and built the neural network")
    print("----------")
    while True:
        num = input(" 1: Train \n 2: Test \n 3: Blind test \n 4: Restart \n 5: Minor demo \n")
        if int(num) == 1:
            errors = image_recog.do_training(epochs=5, errors=errors)
        elif int(num) == 2:
            test_labels, result = image_recog.do_testing()
        elif int(num) == 3:
            results = image_recog.blind_test(images)
        elif int(num) == 4:
            start()
        elif int(num) == 5:
            minor_demo(image_recog)
        else:
            errors = image_recog.do_training(epochs=int(action), errors=errors)
Example #19
0
def addStreamUser():
    streamVar = []
    streamLoop = input(msg="How many users do you want to add?")
    for n in range(int(streamLoop)):
        newSite = input(msg="Enter a folder name")
        streamVar.append(newSite)
    click("1281378408702.png")
    sleep(2)
    if exists("1281378628280.png"):
        click("1281378628280.png")
    sleep(2)
    if exists("1281378675394.png"):
        click("1281378675394.png")
    sleep(1)
    if exists("1281378891204.png"):
        click("1281378891204.png")
    sleep(1)
    if exists("1281378933146.png"):
        doubleClick("1281378933146.png")
    sleep(1)
    if exists("1281379393061.png"):
        click("1281379393061.png")
    sleep(1)

    for stream in streamVar:
        if exists("1281379158106.png"):
            click("1281379158106.png")
        sleep(1)
        type(stream + "\n")
Example #20
0
def move_object(s):
    obj = input("Enter Object Handle: ")
    source = input("Enter Collection Handle to Move From: ")
    dest = input("Enter Collection Handle to Move To: ")

    DCC.dcc_move(s, obj, source, dest)
    return
Example #21
0
 def get_modification(self):  # integrate options, perhaps send to 'get' functions and change those to file mods
     choice = None
     resume = False
     while choice != "q":
         if self.mod_key == "Resume":
             # if self.mod_value != None:
             # print("\n\t\tHere is the current resume.")
             # resume = self.controller.get_resume(self)
             # self.open_resume(resume)
             # choice = input("Please enter the new resumes file path\nand file name with a .pdf ending: ")
             # resume = self.save_resume(choice)
             # new_value = choice
             print("\n\t\tResume saving inside database is currently malfunctioning, pick another option please.")
             time.sleep(4)
             break
         else:
             print("\n\t\tYou have chosen to modify '{}'.\n".format(self.mod_key))
             print("\nOpening contents in text editor. Please modify and save the file.")
             self.open_data()
             new_value = None
         choice = input("\n\t\tPress enter to continue when ready...")
         if not new_value:
             new_value = self.save_data()
         Menu.clear_screen()
         print("\nThe information you have entered is:\n{}".format(new_value))
         verify = input("Is this correct? 'y' to confirm: ").lower()
         if Menu.verify_yes_no(verify):
             print("\nEntry complete and saving now.")
             if resume:
                 self.info[self.mod_key] = resume.encode("utf8")
             else:
                 self.info[self.mod_key] = new_value
             choice = "q"
             time.sleep(2)
             return resume
Example #22
0
def prePublishCheck(p, force=False, interactive=True):
    need_ok = False
    if p.description.get("bin", None) is not None:
        logging.warning(
            "This is an executable application, not a re-usable library module. Other modules will not be able to depend on it!"
        )
        need_ok = True

    official_keywords = [x for x in p.getKeywords() if x.endswith("-official")]
    if len(official_keywords):
        need_ok = True
        for k in official_keywords:
            prefix = k[: -len("-official")]
            logging.warning(
                (
                    "You're publishing with the %s tag. Is this really an "
                    + "officially supported %s module? If not, please remove the %s "
                    + "tag from your %s file. If you are unsure, please ask on the "
                    + "issue tracker."
                )
                % (k, prefix, k, p.description_filename)
            )

    if need_ok and not interactive:
        logging.error("--noninteractive prevents user confirmation. Please re-run with --force")
        return 1

    if need_ok and not force:
        input("If you still want to publish, press [enter] to continue.")

    return 0
Example #23
0
def diagnose():
    if SCRIPT_PATH != os.path.expanduser("~") + "/.shelllocker/main.py":
        print(ansi_colors.YELLOW + "ShellLocker program files are in " + SCRIPT_PATH + ansi_colors.RESET)
        print(ansi_colors.YELLOW + "ShellLocker program files should be in ~/.shelllocker" + ansi_colors.RESET)
        responded = False
        while not responded:
            conf = str(input("Fix? (Y/N): "))
            if conf in ["N", "n"]:
                responded = True
            elif conf in ["Y", "y"]:
                responded = True
                # Fix the issue here
    if not os.access(SCRIPT_PATH, os.X_OK):
        print(ansi_colors.RED + "Script is not an executable!" + ansi_colors.RESET)
        responded = False
        while not responded:
            conf = str(input("Fix? (Y/N): "))
            if conf in ["N", "n"]:
                responded = True
            elif conf in ["Y", "y"]:
                responded = True
                os.system("chmod +x " + SCRIPT_PATH)
    if not os.path.exists(SCRIPT_PARENT_DIR + "/shelllocker.conf"):
        print(ansi_colors.YELLOW + "shelllocker.conf not found" + ansi_colors.RESET)
        print(ansi_colors.YELLOW + "Run with '-s' flag to generate the file" + ansi_colors.RESET)
def Scelta(x):

    if x == 1:
        print input("Scrivi il calcolo: ")
        Scelta(input("Scegli l'operazione: "))

    elif x == 2:
        print input("Scrivi numero: ") ** input("Scrivi esponente: ")
        Scelta(input("Scegli l'operazione: "))

    elif x == 3:
        print math.sqrt(input("Scrivi numero: "))
        Scelta(input("Scegli l'operazione: "))

    elif x == 4:
        clear()
        print "-" * 60, "\n"
        print "\tGRAZIE PER AVER SCARICATO QUESTA CALCOLATRICE", "\n"
        print "\t" * 2, "Alessandro Alfieri"
        print "-" * 60, "\n"
        exit()

    else:
        clear()
        print "Scelta sbagliata, amico! Fatti meno seghe cosi' vedi meglio i numeri!!! ;)", "\n"
        print "Scegli l'operazione che vuoi fare..."
        print "1:Addizione-Sottrazione-Moltiplicazione-Divisione"
        print "2:Elevazione a potenza"
        print "3:Radice"
        print "4:Esci"
        Scelta(input("Scegli l'operazione: "))
Example #25
0
def player_turn():
    print("\n\n=============\nPLAYER'S TURN\n=============")
    valid = False
    while valid == False:
        try:
            column = int(input("Type the column to target: "))
            if column > 7:
                print("You must type a number between 0 and 7.")
                continue
            row = int(input("Type the row to target: "))
            if row > 7:
                print("You must type a number between 0 and 7.")
                continue
            cell = cgrid[row][column]
            if cell == "X":
                print("You have already targeted that cell.")
                continue
            valid = True
        except ValueError:
            print("You must type a number between 0 and 7.")
            next
    cgrid[row][column] = "X"
    if cell != 0:
        print("Hit!")
        cshipcount[cell] -= 1
        if cshipcount[cell] == 0:
            print("You sunk the computer's ship {0}.\n".format(cell))
            cshipcount[cell] == "X"
        cshipcount[0] -= 1
    else:
        print("Miss.")
    if cshipcount[0] == 0:
        print("\n******You have won!******")
    else:
        input("Press <Enter> to continue.")
Example #26
0
 def secure_port(self):
     """This function Secures port"""
     if self.app.pargs.user_input:
         while not self.app.pargs.user_input.isdigit():
             Log.info(self, "Please Enter valid port number ")
             self.app.pargs.user_input = input("EasyEngine " "admin port [22222]:")
     if not self.app.pargs.user_input:
         port = input("EasyEngine admin port [22222]:")
         if port == "":
             self.app.pargs.user_input = 22222
         while not port.isdigit() and port != "":
             Log.info(self, "Please Enter valid port number :")
             port = input("EasyEngine admin port [22222]:")
         self.app.pargs.user_input = port
     if EEVariables.ee_platform_distro == "Ubuntu":
         EEShellExec.cmd_exec(
             self,
             'sed -i "s/listen.*/listen '
             '{port} default_server ssl spdy;/" '
             "/etc/nginx/sites-available/22222".format(port=self.app.pargs.user_input),
         )
     if EEVariables.ee_platform_distro == "debian":
         EEShellExec.cmd_exec(
             self,
             'sed -i "s/listen.*/listen '
             '{port} default_server ssl;/" '
             "/etc/nginx/sites-available/22222".format(port=self.app.pargs.user_input),
         )
     EEGit.add(self, ["/etc/nginx"], msg="Adding changed secure port into Git")
     EEService.reload_service(self, "nginx")
     Log.info(self, "Successfully port changed {port}".format(port=self.app.pargs.user_input))
Example #27
0
def read_database():
    what_skill = input("What skill level are we looking for? ")
    what_lang = input("What language?: ")
    sql = "SELECT * FROM example WHERE Skill == ? AND Language = ?"

    for row in c.execute(sql, [(what_skill), (what_lang)]):
        print(row)
Example #28
0
def main():
    length = int(input("enter the length:"))
    width = int(input("enter the width:"))
    perimeter = perimeter_of_rectangle(length, width)
    area = area_of_rectangle(length, width)
    print("perimeter_of_rectangle:", int(perimeter))
    print("area_of_rectangle :", int(area))
Example #29
0
File: pbl.py Project: ASU-bots/PBL
def get_screen_object(name, times=1):
    """
	Grabs a portion of the screen and outputs it to a file under bmp/name<number>.bmp

	Args:
		name (string): a name to give the set of images
		times (int): number of images to take

	Returns:
		List: Empty if failed, filename strings if succeeded.

	Raises:
		
	"""

    file_list = []

    for i in xrange(times):

        try:
            input("move mouse to top left corner, then press enter.")
        except SyntaxError, NameError:
            pass
        tl = ap.mouse.get_pos()
        try:
            input("move mouse to bottom right corner, then press enter.")
        except SyntaxError, NameError:
            pass
Example #30
0
def main():
    # Get module name to load
    modStringTemplate = open("Models/fracdist_var.py", "rt").read()

    # Get OpenCL platform/device numbers
    if len(sys.argv) < 3:
        # User input of OpenCL setup
        import pyopencl as cl

        # Platform
        platforms = cl.get_platforms()
        print "Select OpenCL platform:"
        for i in range(len(platforms)):
            print "press " + str(i) + " for " + str(platforms[i])
        platnum = int(input("Platform Number: "))

        # Device
        devices = platforms[platnum].get_devices()
        print "Select OpenCL device:"
        for i in range(len(devices)):
            print "press " + str(i) + " for " + str(devices[i])
        devnum = int(input("Device Number: "))
    else:
        platnum = int(sys.argv[2])
        devnum = int(sys.argv[3])

    # Set up complete, now run the simulation
    for d in range(5):
        dist = (d + 5) * 3 + 5
        simulate(modStringTemplate % (-dist, dist), platnum, devnum)