ehm....
put the file somewhere reachable by your app. Let's say you put a file
"hello.txt" into the private/ folder.
import os
def myfunction():
filepath = os.path.join(request.folder, "private", "hello.txt")
with open(filepath) as g:
content = g.read()
return dict(content=content)
On Monday, February 11, 2013 9:54:34 PM UTC+1, rh wrote:
>
> On Mon, 11 Feb 2013 11:33:56 -0800 (PST)
> Niphlod <[email protected] <javascript:>> wrote:
>
> > open the file, read it and do what you need to do..... your question
> > leaves a lot of holes about what you're trying to do.
>
> Not sure what you mean about holes, I did find an example right under
> my nose in the admin app.
>
> I have a file.
> I want to read in the contents.
> I want to display those contents when a page is visited.
>
> What more can I say about that?
>
> >
> > On Monday, February 11, 2013 7:52:38 PM UTC+1, rh wrote:
> > >
> > > I have a text file and want to generate a page using that file's
> > > contents instead of querying a db.
> > >
> > > I have looked at all the web2py-appliances but could not find an
> > > example.
> > >
> > > I create the text file, so I can make it any format.
> > >
> > >
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google
> > Groups "web2py-users" group. To unsubscribe from this group and stop
> > receiving emails from it, send an email to web2py
> > [email protected] <javascript:>. For
> > more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
>
> --
>
>
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.