Python Forum
Calling a Returned Value to Another Function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling a Returned Value to Another Function
#1
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 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.
Smile
Reply


Messages In This Thread
Calling a Returned Value to Another Function - by valerydolce - Mar-10-2017, 12:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sorting Data Returned From Database Timbo03 9 2,379 Feb-19-2023, 02:12 PM
Last Post: Larz60+
  Calling a function from another function johneven 2 2,994 Jul-09-2019, 12:42 AM
Last Post: micseydel
  Calling function-- how to call simply return value, not whole process juliabrushett 2 3,314 Jul-01-2018, 01:17 AM
Last Post: juliabrushett
  Calling a function to return a list of percentages Liquid_Ocelot 7 6,519 Mar-25-2017, 01:20 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020