Mar-10-2017, 12:55 PM
Hi Gigs,
I'm trying to call a value obtained from a function to another function. In this case, i want to call var_name into
Below is what i did, but it's not working.
NB:
I'm trying to call a value obtained from a function to another function. In this case, i want to call var_name into
get_dirs_from_path()
function.Below is what i did, but it's not working.
NB:
get_dirs_from_path()
must not have a parameter.#! /usr/bin/python3 import os import sys def get_environment_variable_value(variable_name): var_name = os.environ[variable_name] if not var_name: return "" else: return var_name def get_dirs_from_path(): path_var = var_name directories = path_var.split(':') for entry in directories: print (entry)Please advise.
