The Python Oracle

Calling a function of a module by using its name (a string)

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Dream Voyager Looping

--

Chapters
00:00 Question
00:22 Accepted answer (Score 2776)
00:45 Answer 2 (Score 730)
01:07 Answer 3 (Score 456)
01:24 Answer 4 (Score 157)
02:10 Thank you

--

Full question
https://stackoverflow.com/questions/3061...

Accepted answer links:
[getattr]: https://docs.python.org/library/function...

Answer 2 links:
[locals()]: http://docs.python.org/library/functions...
[globals()]: http://docs.python.org/library/functions...

Answer 3 links:
[Patrick's solution]: https://stackoverflow.com/a/3071/365102

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #object #reflection

#avk47