Apr-21-2021, 10:20 AM
@bowlofred
ok my mistake to not being precise enough; the current post is in the continuity of this one (I thought it was a better idea to open a new one to speak about the use of exec(), locals(), globals() and eval()).
(print is just a way highlight my need)
Currently:
In a first stage, and based on the list of dictionary names, I do not know how to pass to a function a variable number of dictionaries except using exec() and so on.
Hope it is clearer now
(one issue after another one
)
ok my mistake to not being precise enough; the current post is in the continuity of this one (I thought it was a better idea to open a new one to speak about the use of exec(), locals(), globals() and eval()).
(print is just a way highlight my need)
Currently:
- I'm dealing with a lot of data that are recorded in a first time in dictionaries
- the name of a dictionary depends on what I'm getting, so it's implicitly a variable
- the number of dictionaries varies
- the keys name is also a variable
- values are (numpy) arrays (containing millions of rows and up to dozens of columns - in other word the size of the array can be huge)
- in parallel to dictionnaries creation, a dictionnary names list is created and updated
- because of all these variables, I'm using a mix of exec(), locals(), gobals(), eval() to dynamically work with names (for dictionaries, keys, and so on) and I know it's not a correct way to do under Python (for all reasons ever evocked)
In a first stage, and based on the list of dictionary names, I do not know how to pass to a function a variable number of dictionaries except using exec() and so on.
Hope it is clearer now
(one issue after another one
![Wink Wink](https://python-forum.io/images/smilies/wink.png)