When you render your template, pass in the module as a variable:
import eyed3
...
render_template("something.html", eyed3=eyed3)
Or add it to your template globals:
http://jinja.pocoo.org/docs/dev/api/#jinja2.Environment.globals
Though some would say it'd be cleaner to do that kind of processing in your
normal python code before it reaches the template. Parsing ID3 tags is a
pretty heavyweight operation (file I/O that could throw all kinds of
exceptions), so it might not be a good idea to do it in the template.
-Steve
On Fri, Feb 13, 2015 at 6:56 AM, Edward Webster <[email protected]>
wrote:
> Hello,
> My for x in list worked fine but this won't:
> {{ eyed3.load(x).tag.artist }}
> . An error comes up saying that eyed3 is undefined . I have imported it to
> my .py file but can't figure out how to into my html.
> Please help,
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups
> "pocoo-libs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pocoo-libs.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pocoo-libs.
For more options, visit https://groups.google.com/d/optout.