On Fri, May 9, 2008 at 3:35 AM, globalrev <[EMAIL PROTECTED]> wrote:
>
> i am writing a small fun-app that will have a little box where you can
> fill in text and then encrypt it to the robbers language(, consonant +
> o + consonant, dad is dadodad, super is sosupoperar etc).
>
> anyway, how do i access pythoncode from my html-pages?
>
> i have main-file and a templates-directory and the site is upa nd
> running.
>
> can i write ina html-file something like import file file.func() ?
If you using web.py templating, you can add your function to template
globals, which allows you to use that function in any template.
from file import func
render = web.template.render('templates/')
web.template.Template.globals['func'] = func
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---