I have a few lines that add results from functions to a list. I'm trying to turn it into a loop rather then continuous lines of assignments and append's.
so far i have the code how I want it, I'm just struggling to turn the actual string into calls to functions. I've read the pocket python guide and various other python books yet am unable to find the solution.
categories = ['Hours', 'Travel', 'Site', 'Date']
indexloc == 0
for i in categories:
func = 'v'+categories[indexloc]+' = Get'+categories[indexloc]
indexloc += 1
The results that i get are spot on im just unsure how to translate them into function calls:
>>>
vHours = GetHours
vTravel = GetTravel
vSite = GetSite
vDate = GetDate
>>>
(Just to clarify the Get parts are the function calls)
I've read Calling a function of a module from a string with the function's name in Python but im failing to see if/how it applies to my situation
Python 2.7 razcrasp@gmail.com Thanks