Dec-27-2023, 05:57 AM
The code below works however it runs the function get_m_g() twice.
which takes you through the selection process a second time.
How do I get the return values of the get_m_g function and pass them to another function without going through the choices a second time?
which takes you through the selection process a second time.
How do I get the return values of the get_m_g function and pass them to another function without going through the choices a second time?
def list_m_g(): file = 'List_O_E.ods' df = pd.read_excel(file) m_list = df.columns return m_list def get_m_g(): m_g = inquirer.checkbox( message="\nChoose the m g to work on today:", choices=list_m_g(), validate=lambda result: len(result) > 0 and len(result) <= 2, invalid_message="should be at least 1 m g and no more then 2", instruction="(\nselect up to 2 m g)", ).execute() return(m_g) def get_e(): m_c = get_m_g()