On 27-Apr-2001 Bjorn Pettersen wrote: >> From: Colin Meeks [mailto:colinmeeks at home.com] >> >> Does anybody know if it's possible to do something along the >> following lines >> : >> >> myfunction="test" >> x=myfunction >> >> Basically what I want is when the x variable gets declared it >> get's it's >> data from the function test() > > myfunction = eval('test') > x = myfunction() > > of course, if you're not sure what you're passing to eval you might get > surprising results <wink> > my question is why use a string? You can just use the function itself: myfunc = existing_func x = myfunc()
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4