6 ms·
Python‘s way of accomplishing this is as easy, although the use of `locals` should indicate that this isn’t generally something you should be doing: post =
by ijoshua 18y ago
Python‘s way of accomplishing this is as easy, although the use of `locals` should indicate that this isn’t generally something you should be doing:
post = {'name': 'ijoshua', 'email': 'spam@example.com', 'extra': 'data'}
filter = ['name', 'email']
for k in filter: locals()[k] = post[k]
print name, email