alright. import os cur_dir = os.path.dirname(__file__) # will give you the absolute path to your controllers directory statics_dir = os.path.abspath(os.path.join(cur_dir, "../public")) # will give you the absolute path your public directory in your TG application.
and then you can open your file from statics_dir/file.csv On Feb 13, 9:16 pm, Vidya Setlur <[email protected]> wrote: > I guess I still don't understand what the absolute path to the csv > should be if I have it in my turbogears project under static/csvdata/? > > Thanks. > > > > > > > > On Wed, Feb 13, 2013 at 11:13 AM, Mengu <[email protected]> wrote: > > you should try it with an absolute path to the file. relative path may > > not be resolving the destination. > > > On Feb 13, 8:58 pm, vrs762 <[email protected]> wrote: > >> Hi, > > >> I'd like to open a csv file and parse the contents. I placed the file under > >> static/csvdata. However when I try to open it int he controller, I get an > >> error saying file or directory not found. > > >> Is there a specific place I'd need to place the csv file for the controller > >> to open and read? > > >> Thanks! > > > -- > > You received this message because you are subscribed to the Google Groups > > "TurboGears" 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 athttp://groups.google.com/group/turbogears?hl=en. > > For more options, visithttps://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en. For more options, visit https://groups.google.com/groups/opt_out.

