TheGoodUser
TheGoodUser

Reputation: 1198

Import Python codes inside HTML file

As mentioned here, I can import Python codes inside .html files using <% and %> tags. Just to try it, I wrote the below code in notepad and save it as a file named test.html :

<html>
<title>
</title>
<body>
<%print ("Hello")%>
</body>

Once I do a double click on the test.html, Chrome opens with the below line on the top :

<%print ("Heloo")%>

What I must I do to have 'Hello' in output?

Note: "print" is an example, What kind of ways is there to import and run python codes in html files?

Upvotes: 2

Views: 15492

Answers (1)

mpcabd
mpcabd

Reputation: 1807

That page is related to Karrigell a Python web framework, you can only have Python and HTML files (Web pages) if you use a Python web framework like web.py, Pylons, Django, and others.

Browsers can only execute JavaScript code, other programming languages have to use special components to be executed by browsers.

Upvotes: 2

Related Questions