We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
And for the sake of wanting to learn... I decided to look up how to replicate the ability to call a function via a name stored in a variable. In PHP, it would be $func(var); but I found in Python, it is getattr(Object, Function)(Vars)
Example of using this method below. Again, this is assuming the user isn't going to enter in an invalid command!
Lists
You are viewing a single comment's thread. Return to all comments →
And for the sake of wanting to learn... I decided to look up how to replicate the ability to call a function via a name stored in a variable. In PHP, it would be
$func(var);
but I found in Python, it isgetattr(Object, Function)(Vars)
Example of using this method below. Again, this is assuming the user isn't going to enter in an invalid command!