Trying to build code-list independent from main file
#### expense_codelist.py #### def thelist(filename_list): fn_type = filename_list.split('-') pay_method_var = fn_type[1] if fn_type[0] == 'Chase': pay_method_val = 'Credit Card' card_name == 'Chase' proceed = 'Y' if fn_type[0] == 'Expenses': pay_method_val = 'Debit Card' card_name = 'Bancontact' proceed = 'Y' return if fn_type[0] == 'ING Credit Card': pay_method_val = 'Credit Card' card_name = 'ING' proceed = 'Y' if fn_type[0] == 'Capital One': pay_method_val = 'Credit Card' card_name = 'Capital One' proceed = 'Y' I want to use the variables pay_method_val, card_name, proceed to be returned to the main script. What I tried is below:
#### process.py #### import expense_codelist print expense_codelist.thelist(incsvfn)proceed I am getting the below Error:
print expense_codelist.thelist(incsvfn).proceed AttributeError: 'NoneType' object has no attribute 'proceed'
returnthose values in your function theneliffor the other conditions to make the code more efficient.