I have a list of strings which form mathematical expressions, for example:
my_list = ["23*a*(1-b)", "19*32-4", ..., "0.3232*(1-0.53)*(-1)"]
Each string is actually very long (in the order of 100 - 25000 'lines' of code), and I have a lot of strings such as this. When I save each string to a text file, and then make a function out of it by copy and paste, it generally takes too long to formulate the return statement.
def f(args):
return (long string contents)
i.e. the return statement can be tens of thousands of terms long and in Jupyter notebooks, my cell never stops processing, even after around 20 minutes.
Apart from sitting here and unpacking all the terms into lines and then aggregating those lines, what can I do?