If you had two strings, like so ->
string1 = "get"
string2 = "Feed"
So how would you use these 2 strings to call a function named -> getFeed() ?
Depending on where the function is, you can use one of these:
globals()[string1 + string2]()
locals()[string1 + string2]()
If ImportedLib had your function getFeed(), you'd call it as such:
import ImportedLib
getattr(ImportedLib, string1+string2)()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With