Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8078823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:54:51+00:00 2026-06-05T15:54:51+00:00

I have a typical Pyramid web application setup. The application directory (I don’t know

  • 0

I have a typical Pyramid web application setup. The application directory (I don’t know what this directory is called in Pyramid?) contains the static, templates and ini.py files. In this directory I also created a directory called static_content that I use to store some special report templates.

In my view code I am using something like this to read the files in the sub-directories of the static_content directory:

f = open("/static_content/abc/report_template.tpt" , "r")

Then over in my init.py file I added a line:

config.add_static_view("static_content", "static_content")

I get an IO Error…..how do I fix this?

Regards,
Mark Huang

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:54:52+00:00Added an answer on June 5, 2026 at 3:54 pm
    f = open("/static_content/abc/report_template.tpt" , "r")
    

    A leading slash in a file’s path means you’re giving it the full path (the file is at this exact location). If you want a relative path, take off the leading slash:

    f = open("static_content/abc/report_template.tpt" , "r")
    

    This tells it to follow that path from the current directory.

    You may want to look at this question in order to build a relative path from the script file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have typical web application based on PHP, HTML, and javascript. From an HTML
I have a typical reporting application: Large report <-- HTTP Compression --> ASP.NET Web
I have a typical SlidingDrawer in my app, but i don't know how to
I have a typical setup for displaying charts for MVC3 web page - Here
I don't get this, I have a typical messageSource <bean id=resource class=org.springframework.context.support.ResourceBundleMessageSource> <property name=basenames>
I have this typical scenario. I have a smartclient application built on .net 2.0
In my MVC 2 application I have a typical method that calls a web
I have a typical web application in Node that is utilizing the Express framework
we have a typical web application stack. there are 120 selenium (webdriver) tests that
We have a typical web-based login system. We want customers to have the ability

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.