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

  • Home
  • SEARCH
  • 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 8698595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:45:47+00:00 2026-06-13T01:45:47+00:00

Below, I print out the html for a form defined externally. Is there a

  • 0

Below, I print out the html for a form defined externally. Is there a difference in the way each string is retrieved and used in foo.py, other than the syntax? If so, in what circumstances would one method be preferred over the other? For example, would I be better off defining a number of html files in a module as strings and access them that way, as opposed keeping them in separate .html files and using open over and over?

mod.py

form = """\
<form type="POST" action="test.py">
   Enter something:<input type="text" name="somethign">
</form>
"""

form.html

<form type="POST" action="test.py">
   Enter something:<input type="text" name="something">
</form>

foo.py

import mod

print mod.form

with open('form.html', 'r') as form:
   print form.read()
  • 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-13T01:45:48+00:00Added an answer on June 13, 2026 at 1:45 am

    Having .html files is better. Sure, you will have some overhead opening a file, reading its content and then closing it, but you’ll have many advantages:

    • .html file can be edited by any person who knows HTML syntax.
    • .html files can be edited without restarting your program, it is very useful for services.
    • You can eliminate open/read/close overhead by introducing some caching technique.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting weird results from the System.out.print immediately below the Scanner declaration in the
I'm using the code below to print out rows containing 4 columns. How would
I'm trying to print out a html-table from db-table 'dimensions'. I only want dimensions
Is there any way to point the Devise authenticator at my custom login form?
The code below prints out all comments for a given submissionid in chronological order.
In the method below titleForHeaderInSection , for some reason the NSLog prints out the
The below code doesn't it print the value. function go(x) { alert(x.options.selectedIndex.value); //location=document.menu.student.options[document.menu.student.selectedIndex].value }
In the example below, if client code using GetPeople wanted to print the name
I have two servlets below and work well with Tomcat7/Indigo, it will print '
Is there a solution to the problem illustrated in the code below? Start by

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.