Quantcast
Channel: Calling a function of a module by using its name (a string) - Stack Overflow
Browsing all 22 articles
Browse latest View live

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

You should take a look to qcall:from qcall import callcall("foo.bar") # calls foo.bar()

View Article


Answer by Daniel Viglione for Calling a function of a module by using its...

Verified and tested:# demo.pyimport sysdef f1(): print("Function 1 called")def f2(): print("Function 2 called")def f3(): print("Function 3 called")def f4(): print("Function 4 called")functions = {"f1":...

View Article

Browsing all 22 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>