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 9001331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:25:20+00:00 2026-06-16T00:25:20+00:00

The project I’m currently working on requires me to use the Python’s built in

  • 0

The project I’m currently working on requires me to use the Python’s built in HTTP server and I need to build dynamic HTML pages on my own. The %REPLACE_ME% syntax in HTML files has recently got too annoying and I’d love to replace it with in-place code as it’s done in PHP. Is there any good solution to parsing a string with (or any other similar syntax) and evaling the code inside?

Edit:

Jon Clements pointed me out that I forgot to explain why would I need the in-place code. There are two reasons – first is that I’m used to such approach, the latter being that I’d like to use some loops and don’t want to end myself constructing half of the HTML code for e.g. tables in the model file. The stdlib requirement is because I’d like to keep dependencies as little as possible. I could allow for some really really slim library for that though.

  • 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-16T00:25:21+00:00Added an answer on June 16, 2026 at 12:25 am

    As per the last comment I will try and outline some options:

    Built in to python the best options is the string module.

    As stated in the comments the documentation is here: 7.1. string

    There are a lot of third party templating systems which are incredibly powerful. I am not a big PHP user but you would class these similar to Smarty etc…

    Django Template

    There is also a great open source book related to using them Django Book: Chapter 4 – Templating

    I have never used these outside of Django but I know there is a few frameworks which let you use them. I am not to sure how much work this would be to integrate it with another system but it definitely can be done.

    Mako Templates

    This is another good templating system which is really powerful. This is used by some big frameworks like Pylons.

    Jinja2

    This is also a good templating system.

    There are a few other discussions around SO about templating systems: What is the fastest template system for Python?. This is just an example but there is a much bigger list of template systems there.

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

Sidebar

Related Questions

Project: http://design.vitalbmx.com/fave/news.html When I click Add to favorites button (under main pic), in Chrome
Project being built on ASP.net v 2 VB.net IIS 6 SQL Server 2005 database
Project file here if you want to download: http://files.me.com/knyck2/918odc So I am working on
The project I am currently working on has, in the checkout, an option to
The project I'm working on has an Oracle backend, and we use SQL Navigator
The project I am working on requires some executions to be done at a
Project Requirements: I need to build a web service that will receive chunks of
Project layout: /project_a /shared /project_b /shared /shared project_a and project_b both need to contain
The project that I am working on (Node.js) implies lots of operations with the
The project currently has a UIviewController called Dashboard that acts as the main view

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.