Can we find elements or values in this way?

Asked 2 years ago, Updated 2 years ago, 16 views

If there is a list or a specified value as shown in the code below, can we find a list or a specified value in the current script through the command rather than manually finding it?

In the case of a list, it needs to be deleted periodically for memory management, but the longer the code gets, the more lazy it is to find the list one by one and enter the delete command of the list, so I really want to solve it.

a = []
b =[]
c  =[]
c =[]
ss =[]
djen =[]
jdnsn =[]
djdj=[]
jdjd = []
dbdjsj = £
sjej = djs
djsn = £§£§
sjdns = £&£[£

# A function that finds the generated list
ex) The list is a, b, c, d, ... There's this
# A function that finds randomly specified values, such as sjsj = djs
ex) dbdjsj = £, sjej = djs, djsn = £§£§, ...
Or
dbdjsj, sjej, djsn, ...
Output in the same way

python

2022-09-20 19:24

1 Answers

It looks like you'll have to take the Python parser and find it in the source code.

Of course, Python's variables are managed by dict, and you can find them in the globals area, but finding things that are declared in a function or class is not something you can do during runtime.

If you really want to do it during runtime, you can create a decoder to collect and declare it for all class functions.


2022-09-20 19:24

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.