I know this was asked for in micropython 5ish years ago, but it seems that it still hasnt been implemented. I was wondering if this would be possible to add? Im currently working on creating a calculator that can be plugged in and have programs modified. The menu system ended up using that functionality.
class Program(object):
def exec():
'''to be implemented in programs'''
pass
def run(self):
params = self.exec.__code__.co_varnames[1:self.exec.__code__.co_argcount]
argList = []
for param in params:
argList.append(float(input(f"{param}: ")))
funcKwarg = dict(zip(params, argList))
print(f"Result: {self.exec(**funcKwarg)}")
If this isnt possible thats also fine, just wondering if it is possible.
I know this was asked for in micropython 5ish years ago, but it seems that it still hasnt been implemented. I was wondering if this would be possible to add? Im currently working on creating a calculator that can be plugged in and have programs modified. The menu system ended up using that functionality.
If this isnt possible thats also fine, just wondering if it is possible.