-
-
Save taljaards/b3cc0b13e1d6bdd13046388d34f044a6 to your computer and use it in GitHub Desktop.
Two files: 1 - Code to get user input for the rest of the main script, 2 - console output. Why is the console output "slow"?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default_flag = 'y' | |
def get_input(prompt, default_value, default_flag_=default_flag, print_=True): | |
print() | |
answer = input(prompt) | |
if answer == default_flag_: | |
answer = default_value | |
if print_: | |
logger.info(answer) | |
return answer | |
print('-------------------------------------------------------------------------') | |
print('All input paths need to be entered now. Enter {} to use the default path.'.format(default_flag)) | |
print('-------------------------------------------------------------------------') | |
batching_data_path = get_input('Batching file: ', 'Batching Data_2016_M1-M4.xlsx') | |
customisable_input_path = get_input('Customizable Excel input sheet: ', 'Inputs.xlsx') | |
production_data_path = get_input('Production data (modelling sheet): ', 'modelling_d01.xlsx') | |
kpi_data_path = get_input('KPI sheet: ', 'KPI data sheet.xlsx') | |
print('-------------------------------------------------------------------------') | |
print() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------- | |
All input paths need to be entered now. Enter y to use the default path. | |
------------------------------------------------------------------------- | |
Batching file: y | |
[INFO] Batching Data_2016_M1-M4.xlsx | |
Customizable Excel input sheet: y | |
[INFO] Inputs.xlsx | |
Production data (modelling sheet): y | |
[INFO] modelling_d01.xlsx | |
KPI sheet: y | |
------------------------------------------------------------------------- | |
[INFO] KPI data sheet.xlsx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment