I have a working python app that I created to automate a process for work. Essentially what the program does is provide an authorization number to a user from a list of numbers, after the user specifies how many they need and for what region. The code works beautifully when ran in the terminal on Mac but on windows when ran in powershell or the output exe from pyinstaller no dice. The selection just sits on the first option and the cursor blinks below it.
Here is a version of my code with the sensitive items removed, but what do I need to do in order to allow a user to cycle through the options? This also works and allows me to select when ran in PyCharm, but whenever it is taken into powershell or the pyinstaller exe output it does not. Appreciate the help, I am sure it is something rather simple I am missing being self taught.
# import the random module
import random
import inquirer
while True:
# define our list of FAN numbers for each region
NA = ["EXAMPLE1", "EXAMPLE2", "EXAMPLE3", "EXAMPLE4"]
EMEA = ["EXAMPLE1", "EXAMPLE2", "EXAMPLE3", "EXAMPLE4"]
APAC = ["EXAMPLE1", "EXAMPLE2", "EXAMPLE3", "EXAMPLE4"]
print('This tool will randomly select from a list of blanket FANs based on the number you specify. \n ')
# ask which region
questions = [
inquirer.List('region',
message="What region is the FAN for?",
choices=['NA', 'EMEA', 'APAC']
),
inquirer.Text('number',
message="How many FAN numbers do you need? :How many FAN numbers do you need?",
),
]
answers = inquirer.prompt(questions)
region = answers["region"]
number = int(answers["number"])
if region == 'NA':
# dump the FANs we asked for to their own array
fan_selection = random.sample(NA, number)
elif region == 'EMEA':
# dump the FANs we asked for to their own array
fan_selection = random.sample(EMEA, number)
elif region == "APAC":
# dump the FANs we asked for to their own array
fan_selection = random.sample(APAC, number)
# spacing
print('\n')
# collect the quote numbers for the FANs
quote_selection = []
maxLengthList = number
# set our q counter
q = 1
while len(quote_selection) < maxLengthList:
quote = input("Enter Quote Number " + str(q) + " : ")
quote_selection.append(quote)
q = q + 1
# spacing
print('\nCopy and paste the block of text below into the comments field in SmartSheet: \n')
# set our counter to 0
i = 0
# loop through the values while they exist
while i < len(fan_selection):
print('Please use FAN number ', fan_selection[i], ' for the error in quote ', quote_selection[i])
i = i + 1
# The rest of the message
print('\n**NOTE: The FAN number provided is only valid for the specific error requested.\n')
exit_questions = [
inquirer.List('exit',
message="What would you like to do?",
choices=['Exit', 'Request Another FAN']
),
]
exit_answers = inquirer.prompt(exit_questions)
if exit_answers["exit"] == "Exit":
break
Here is what the console looks like from the pyinstaller exe when ran:
Arrow keys do not move the selections up and down as they do in PyCharm or in the Terminal on Mac.