[Tutor] Assign exec() value to a variable

Eggo why eggo at hotmail.com
Thu Oct 10 17:26:27 EDT 2019


Hi all,
   How can I assign result from exec() into a variable.  Following is my code.

import config

sid='configdb'
SID = ("config.%s()" % sid)
print('--params: ',SID)
params = exec(SID)
print('-- params :',params)


Gary


More information about the Tutor mailing list