简体   繁体   中英

Get variables out of mako Template.render() objects in python?

Is there a way to get the variables from a Template object that was previously created with Template.render(...) in python? I couldn't find any getters in the docs...

Thanks!

Your question contains a wrong assumption:

from a Template object that was previously created with Template.render(...)

According to the code , Template.render() or Template.render_unicode() return a byte string or a unicode object, respectively (no "Template object"!). In that case, there is no way to retrieve the variables used for rendering the template, that information is lost.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM